0
votes

Can I use Azure AD Login parallel to database login to my web application using JAAS? I have created a web app in azure portal and have tried the login using the code present here: https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/dev/src/samples/public-client-app-sample/src/main/java/PublicClient.java

But I'm facing issues like

The request body must contain the following parameter: 'client_secret or client_assertion'.\r\nTrace ID: fd0sxdac-72a3-4ac2-9aca-02aa64bb8ef5\r\nCorrelation ID: 96xsdb2c-864e-4325-b8cb-98fb6d6ab541\r\nTimestamp: 2017-02-10 13:30:02Z","error":"invalid_client"} at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:108)

I changed my app to native app and tried login again, but this time I ended up getting this error:

com.microsoft.aad.adal4j.AuthenticationException: {"error_description":"AADSTS65001: The user or administrator has not consented to use the application with ID '7xxxyyy9-bcf6-4uu1-bzzz6-d279189ea7bf'. Send an interactive authorization request for this user and resource.\r\nTrace ID: cbd15f8a-983b-469f-9e20-bf0c8eee4e0c\r\nCorrelation ID: 213bb116-3617-4b89-8170-a123e072bfb5\r\nTimestamp: 2017-02-10 15:32:12Z","error":"invalid_grant"} at com.microsoft.aad.adal4j.AdalTokenRequest.executeOAuthRequestAndProcessResponse(AdalTokenRequest.java:108)

I've added the required permissions to the app using Microsoft Graph (sign in and read user profile), but still doesn't work. I'd really appreciate if one of you could point me in the right direction.

1

1 Answers

0
votes

Figured out the answer actually, I just had to grant the relevant permissions on the application and it started to work.