-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Msal Angular cannot pass multiple consent scopes from different apis #508
Comments
So is it , or is it not supported:
|
@chigivigi @hkusulja MSAL library should be used with the Azure AD v2.0 endpoint which supports scopes. Please see this explained here. As for the consentScopes you can pass scopes for multiple APIs. However, the purpose of consentScopes is to request the user to consent to these scopes during login. Login in the MSAL library only returns an id token. To get access tokens you can use the acquireToken methods. Since you are using the Angular wrapper, the library will intercept your requests to the API and get this access token for you. This is explained here. |
I used acquireTokenSilent to get CRM access token but when I make a request with it I got the response Error 401. |
@chigivigi Did you remember to add the allowed token audiences for the client app registration? |
I looked at at the allowed token audiences for the client app registration but I am testing my application locally. If it helps I gave all the necessary permissions in my app registration. |
@chigivigi If the API is returning 401, is there a more detailed error message? Please let us know if this is resolved for you. |
There is no error message. I don't get any response back. |
@chigivigi can you make sure your scope has a double forward slash in it? I'm not sure if your |
@chigivigi have you tried @bguidinger 's suggestion? Also we support 'scopes' per resource at a time for accessTokens but can pre consent at the time of signing in (idToken) only. We have recently gone through a redesign of the library's API surface. Please download our latest preview package or pull the dev branch and try updating your code and see if the issue still persists. Please re-open this issue if it persists. We are now throwing error stack traces so we can understand better why your code is failing. If you would like guidance on how to use the new version of the library, please review our wiki page here. |
I'm submitting a...
Browser:
Library version
The text was updated successfully, but these errors were encountered: