Comments (5)
Ok so made a little headway..
So I was using the credit on my MDSN account, which meant it was hooking into our corporate directory. As there doesn't seem to be way to create your own :(
So I signed up a trial account and setup an Azure AD there.. So no longer get a corporate a malformed url.. But getting:
{"error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID 'xxxxxxxxx' named 'Native'. Send an interactive authorization request for this user and resource.\r\nTrace ID: 70d302b6-e22a-4817-b905-6ddd3ded2d00\r\nCorrelation ID: ccfc3572-7a82-435b-a278-672ca8e9764b\r\nTimestamp: 2018-04-09 20:59:30Z","error":"invalid_grant"}
So will now look into how to solve these 2 issues.. Any help or suggestion would be appreciated :)
from active-directory-java-native-headless.
Hi @whgibbo did you click on "Grant Permissions" in the "Required Permissions" blade in the registered application settings?
from active-directory-java-native-headless.
Yes I think that was the missing step :) Thanks..
So now I have it working for the a personal azure account, but wanted to try on MSDN account, which is hooked to the corporate directory.
But this yields the following:
Exception in thread "main" java.util.concurrent.ExecutionException: java.net.MalformedURLException: no protocol:
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at PublicClient.getAccessTokenFromUserCredentials(PublicClient.java:74)
at PublicClient.main(PublicClient.java:39)
Caused by: java.net.MalformedURLException: no protocol:
at java.net.URL.(URL.java:593)
at java.net.URL.(URL.java:490)
at java.net.URL.(URL.java:439)
at com.microsoft.aad.adal4j.HttpHelper.openConnection(HttpHelper.java:119)
at com.microsoft.aad.adal4j.HttpHelper.executeHttpGet(HttpHelper.java:48)
at com.microsoft.aad.adal4j.HttpHelper.executeHttpGet(HttpHelper.java:42)
at com.microsoft.aad.adal4j.WSTrustRequest.execute(WSTrustRequest.java:82)
at com.microsoft.aad.adal4j.AuthenticationContext.processPasswordGrant(AuthenticationContext.java:990)
at com.microsoft.aad.adal4j.AuthenticationContext.access$000(AuthenticationContext.java:69)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:178)
at com.microsoft.aad.adal4j.AuthenticationContext$1.call(AuthenticationContext.java:168)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
So when I step thru the code, I can see with the MSDN account that the userDiscoveryResponse is a Federated account (AuthenticationContext.java - Line 989). It then appears to obtain the getFederationMetaDataUrl, which is returning an empty string. Which is causing the MalformedURLException..
So will keep searching.
from active-directory-java-native-headless.
Hi @whgibbo
The federated account isn't able to perform the authentication through Azure AD. The federated account store the User Credential into the OnPremisse directory.
I hope help you.
from active-directory-java-native-headless.
This sample has been archived.
The newer one can be found at: https://github.com/Azure-Samples/ms-identity-java-desktop/tree/master/Username-Password-Flow
from active-directory-java-native-headless.
Related Issues (15)
- Client Secret Error HOT 15
- how to set client secret into aquireToken method that uses username and password HOT 2
- Getting javax.net.ssl.SSLHandshakeException HOT 1
- AuthenticationException: WsTrust endpoint not found HOT 5
- Authenticate to Azure AD non interactively in Java HOT 2
- AADSTS90013: Invalid input received from the user HOT 2
- Authenticate to Azure AD fails with access denied HOT 1
- Issue with 'client_secret or client_assertion' missing HOT 1
- The documentation should describe the require change to get the token HOT 5
- Getting error regarding usage of application was not consented HOT 1
- Fail to run the sample, due to error: NullPointerException, policy is null in WSTrustRequest.execute. HOT 8
- Error: Interaction required HOT 4
- Are Client_ID and username the same? HOT 2
- 400 error from IdP HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from active-directory-java-native-headless.