Quantcast
Channel: Azure Active Directory forum
Viewing all articles
Browse latest Browse all 16000

Integration of Java Web Application with Azure AD- Graph API Authentication and Authorization

$
0
0

Hi Team,

I have recently started working on Azure Active Directory and i am trying to integration custom java based web application with Azure AD.

I refer github  (https://github.com/AzureADSamples/WebApp-GraphAPI-Java) java code for the same, however after implementing the same, i am not able to perform any of the desired operations and getting below error.

null=[HTTP/1.1 400 Bad Request], Strict-Transport-Security=[max-age=31536000; includeSubDomains], x-ms-request-id=[1fb86573-f60e-4c85-b88c-f753c114b8b5], Date=[Mon, 11 Aug 2014 13:31:53 GMT], Content-Length=[391], request-id=[1fb86573-f60e-4c85-b88c-f753c114b8b5], Set-Cookie=[stsservicecookie=acs; path=/; secure; HttpOnly, x-ms-gateway-slice=slicea; path=/; secure; HttpOnly], Content-Type=[application/json; charset=utf-8], X-Powered-By=[ASP.NET], Server=[Microsoft-IIS/8.0], X-Content-Type-Options=[nosniff], Cache-Control=[private]}

followed with exception:

Server returned HTTP response code: 400 for URL: https://login.windows.net/cecvpoc.onMicrosoft.com/oauth2/token?api-version=1.0

and strange thing is whenever i try to access https://graphexplorer.cloudapp.net/<tenent-name>/user, it ask for principal ID and symetric key and after providing both when i click on login button i get below error

"Status Code" : "Unauthorized","Description" : "The remote server returned an error: (401) Unauthorized.","Response" : "{"odata.error":{"code":"Authentication_MissingOrMalformed","message":{"lang":"en","value":"Access Token missing or malformed."},"values":null}}"

however, when i log in to graph explorer using my organizational credentials, i always get the user data so i believe it something to do with the way i am registering my application though i followed the same step which present online.

My simple requirement is to have java application which  can search user, create user, modify user in azure active directory and just to add my application should be authenticated and authorized to perform above operation with client id and symmetric key so that user need not to authenticate against WAAD for the same.

Note: i also added roles to my application too: Read, Write and Admin roles too.

Kindly provide some pointers towards the solution, i know this is possible its just i am not able to click the right thing.

Thanks in advance.

Regards,

Anurag


Viewing all articles
Browse latest Browse all 16000

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>