I've got a SPA calling an API. The user authenticates using Azure AD and I'm exposing the API with a custom scope (access).
I report below the responses based on different scopes:
- scopes = ['access'] => Authorised. Scope in the passed token is: "access"
- scopes = ['user.read'] => Not authorised. Scope in the passed token is: "openid profile User.Read email"
- scopes = ['access', 'user.read'] => Authorised. Scope in the passed token is: "access"
- scopes = ['user.read', 'access'] => Not authorised. Scope in the passed token is: "openid profile User.Read email"
- scopes = ['profile', 'email', 'openid', 'access'] => Authorised. Scope in the passed token is: "access"
I don't think it's normal behaviour because I couldn't find any reference around it. What if I need, in the API, the info coming from the User.Read as well?
Dep version: "@azure/msal-browser": "^2.26.0"