question

BONAGIRIAishwarya-2652 avatar image
0 Votes"
BONAGIRIAishwarya-2652 asked BONAGIRIAishwarya-2652 edited

Azure Active Directory SSO Integration

Hi ,

I was trying to integrate Azure AD SSO with my spring app, I had followed documetation(https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory#configure-and-compile-your-app), but had encountered error ( An error occurred while attempting to retrieve the OAuth 2.0 Access Token Response: 401 Unauthorized: [no body]). 59141-image.png


azure-active-directoryazure-ad-single-sign-on
image.png (17.6 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

soumi-MSFT avatar image
0 Votes"
soumi-MSFT answered BONAGIRIAishwarya-2652 edited

Hello @BONAGIRIAishwarya-2652, thank you for reaching out. From the error, it looks like the Spring App failed to reach out to AAD while trying to fetch the token.

Make sure you have entered the correct TenantID, ApplicationID and Application_Secret, and the Group name in the application.properties file present under src/main/resources

As using these properties, the request URL gets created and sent to AAD to request the token.

If those values for the mentioned parameters are correct, still this same error comes up, then we would have to debug the application to understand what the application is sending as a request to AAD, and based on that we can help further. Hence it would be great if you can share us the request which the spring app is sending to AAD to request the token.

Hope this helps.

Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as an Answer; if the above response helped in answering your query.




· 5
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

66442159 avatar image 66442159 BONAGIRIAishwarya-2652 ·

Hi @BONAGIRIAishwarya-2652,
Are you able to get the solution?
if yes please let me know as I am facing the same issue.
Thanks in advance.

0 Votes 0 ·

Hi @PrikshitSharma-8975 ,
With that code. I couldn't succeed(though all the keys were correct). I got similar code from github , which worked.
[https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-boot-sample-active-directory-webapp]

0 Votes 0 ·

I'm also having the exact same issue. I've spent weeks trying to figure this out.

0 Votes 0 ·
Show more comments