c# - Active Directory Authentication Exception (AADSTS90027) with Azure AD -


i have native client application obtaining oauth2 token active directory authorization. use token communicate secure web api server areas of api secured using [authorize] attribute. server registered azure ad , can authorize requests through ad.

when try token, following exception on line 2 of code below:

additional information: invalid_request: aadsts90027: client '<client guid>' , resource 'https://abccompany.com/myapplication.server' identify same application.

here code running in native client (just on button press test, now). guid , company names have been obfuscated.

authenticationcontext ac = new authenticationcontext("https://login.windows.net/abccompany.com"); authenticationresult ar = ac.acquiretoken("https://abccompany.com/myapplication.server", "<client guid>", new uri("https://localhost:44300/secure"), promptbehavior.auto); 

i made sure redirect existed in azure in application configuration (otherwise there have been redirect error instead). error mean?

you seem using clientid of webapi need supply clientid of client app. please register separate 'native client application' in azure ad representing client app.

the following topic explains protocol flow , how register webapis in azure ad such users multiple ad tenants can use api: http://msdn.microsoft.com/en-us/library/azure/dn499820.aspx#bkmk_native following samples should see through:

hope helps.


ps: azure ad doesn't issue token when client , resource same application. in case should indeed different , resource clientid (issued confidential client) should not used public client - service service scenarios, can argued issuing tokens self should allowed - looking into.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -