question

valsarajviswanathan-4298 avatar image
0 Votes"
valsarajviswanathan-4298 asked alfredorevilla-msft commented

Azure AD Authorization integration with spring boot resource server

We need to use Azure AD for authn and authz for a mobile app to post data into spring boot backend application. Generated access token using client credentials for testing and the Spring boot application is configured with jwk url to validate token and it works fine. We used spring starter oidc resource server dependency for this.
Next we need to configure role to the client and control access to the spring boot resource. We have created app role but it's not printed on the spring boot backend when we printed the granted authority on spring boot backend code. Anyone please share what is the correct way to configure Azure AD for this scenario and if anything additional needed to do on the spring boot?

azure-active-directoryazure-spring-cloud
· 1
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.

Hello @valsarajviswanathan-4298, do you need additional assistance? Was the provided answer helpful? If it was, please remember to accept it so that others in the community with similar questions can more easily find a solution.

0 Votes 0 ·

1 Answer

alfredorevilla-msft avatar image
0 Votes"
alfredorevilla-msft answered

Hello @valsarajviswanathan-4298, take a look to Protect a resource server/API and Access other resource servers from a resource server and beyond for samples on how to protect your api using @PreAuthorize("hasRole|hasAuthority|etc") and more.


Let us know if this answer was helpful to you. If so, please remember to accept it so that others in the community with similar questions can more easily find a solution.

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.