GithubHelp home page GithubHelp logo

Comments (5)

whgibbo avatar whgibbo commented on June 15, 2024

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.

sangonzal avatar sangonzal commented on June 15, 2024

Hi @whgibbo did you click on "Grant Permissions" in the "Required Permissions" blade in the registered application settings?

from active-directory-java-native-headless.

whgibbo avatar whgibbo commented on June 15, 2024

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.

gabriel-rcpereira avatar gabriel-rcpereira commented on June 15, 2024

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.

TiagoBrenck avatar TiagoBrenck commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.