We're using Azure AD B2C to authenticate users, via our API. Both Client (Angular 2) and API have the same Client ID.
This all works fine. As scopes I've defined openid
.
However, when calling AcquireTokenAsync after being logged in for more than the expiration time, I'm now getting this error:
"AADB2C90055: The scope 'openid profile' provided in request must specify a resource, such as 'https://example.com/calendar.read'.
I'm calling this method from our Angular application; we're using MSAL.JS. So, it's working fine within the token expiration time (default 60 minutes), but after 60 minutes I'm starting to get this error.
Exactly the same issue as error 1 here: Azure AD B2C Token Issue
Is this a bug in MSAL JS or is our set up incorrect? I'm aware I could have created a separate client ID for our API, but this is working fine for logging in, so I have not bothered. Our API just needs to know the user name, email, etc.
AcquireTokenAsync
? – Chris Padgettopenid
. Believe MSAL.JS is addingprofile
. We're only using it to authenticate a user and get e.g. object ID. I'm still unsure why it works fine for logging in, but not for refreshing tokens. – Bolandoffline_access
scope when using OpenID but I may be mistaken. Regardless, the JWT should include theoffline_access
scope, otherwise AAD won't provide arefresh_token
. If that happens, it would explain why it fails to refresh properly. – Marc LaFleur