question

MirzaevTakhir-2048 avatar image
0 Votes"
MirzaevTakhir-2048 asked ShwetaMathur commented

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

Msal v2 httpInterceptor doesn't work properly

azure-ad-myapps
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

ShwetaMathur avatar image
0 Votes"
ShwetaMathur answered ShwetaMathur commented

Hi @MirzaevTakhir-2048

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

https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-angular/docs/v2-docs/msal-interceptor.md

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

Thanks,
Shweta


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


· 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.

Hi @MirzaevTakhir-2048 Just wanted to check, Are you able to resolve your issue?

0 Votes 0 ·