MSAL v2 HttpInteceptor doesn't put token on the header of the http request.

Mirzaev, Takhir 1 Reputation point

Msal v2 httpInterceptor doesn't work properly

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,800 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 28,031 Reputation points Microsoft Employee

    Hi @Mirzaev, Takhir

    Thanks for reaching out.

    MSAL Angular provides an Interceptor that automatically acquires and handle tokens that use the Angular http client to known protected resources.

    In the Msal Interceptor make sure to configure the protected resources and the corresponding scopes in the protectedResourceMap correctly to get the token for required audience.

    Refer the below sample to setup MSAL Interceptor

    Could you please elaborate what scopes you are setting and the error you are getting while acquiring the token?



    Please remember to "Accept Answer" if answer helped you.