2

Azure AD B2B with MSAL - Angular app is able to authenticate the user and gets the token. Now angular app needs to call APIs (spring boot with MSAL library). How can this token be validated against Azure AD?

user3760894
  • 267
  • 4
  • 13

1 Answers1

0

You get the token from Azure AD. In order to pass it on to your (Spring Boot) backend, an MSAL Interceptor is helpful. The auth code flow is nicely shown here: https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-angular-auth-code

The interceptor than adds the token to all outgoing API calls, that you send via HttpClient.

Windowlicker
  • 498
  • 11
  • 18
  • The thing is, I inject the access token from Azure into each request as a bearer token, but the API still responses 401. So, in addition to including the API as "exposed" into the Azure Portal, do I have to change the way the API receives or decodes this third party token? – jmonloop Jun 23 '22 at 06:34