im working with MSALv2 on Angular 8, and I need disable the authentication for specific endpoints that dont need, is this possible? Here is my config:
export function MSALInterceptorConfigFactory(): MsalInterceptorConfiguration {
const protectedResourceMap = new Map<string, Array<string>>();
protectedResourceMap.set('https://graph.microsoft.com/v1.0/me', ['user.read']);
protectedResourceMap.set(`${environment.API_URL}`, ['api://f70731a6-6df1-4762-b267-54ea9741a7a2/User.read']);
And I need disable the auth only for ${environment.API_URL}` / x-resource Thank you!
Yes, in protected resource map, set the scope to null for that particular endpoint, and make sure that it is placed before any other wildcard endpoints which may match.
For example, if ${environment.API_URL}is all protected, except for the endpoint ${environment.API_URL}/signup then your protectedResourceMap would look something like:
const protectedResourceMap = new Map<string, Array<string> | null>();
protectedResourceMap.set(`${environment.API_URL}/signup`, null);
protectedResourceMap.set(`${environment.API_URL`, environment.API_SCOPES);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With