I am developing a Azure multi-tenant application that uses scopes from the Microsoft Graph API and the Windows Azure Active Directory resources. We are using the v1 OpenID auth code flow.
Recently we added a few more requested scopes to the Microsoft Graph API, we prompted users to reauth using prompt=admin_consent
and resource=https://graph.microsoft.com
on our /common/oauth2/token
exchange.
When the user is prompted to accept scopes again you can see the newly requested scopes and the call seems to complete successfully, we receive a new access_token
.
However the scopes that come back in the response AND the embedded JWT claim for scopes only lists a small subset of the requested scopes and they also only seem to be from one of the resources (Windows Azure Active Directory).
We are receiving 403s for the new scopes so I do not think it is a issue of not correctly populating those scope fields.
Does anyone know why the auth flow would not return a token with the newly requested scopes?
Here is a listed of my requested scopes:
Windows Azure Active Directory
- Read and write directory data (Application)
- Access the directory as the signed-in user (Delegated)
- Read and write directory data (Delegated)
- Sign in and read user profile (Delegated)
Microsoft Graph
- Read and write calendars in all mailboxes (Application) (NEW)
- Read and write all users' full profiles (Application)
- Read and write directory data (Application)
- Send mail as any user (Application) (NEW)
Thanks!
/common/oauth2/authorize
but we do sendresource=https://graph.microsoft.com
(if not specified we get a 400 from the endpoint) on the/common/oauth2/token
call. Yes we have users reauth usingprompt=admin_consent
on next login. – keystoneprompt=admin_consent
forces the Admin Consent flow,prompt=consent
is used for force User Consent. They are different things. Have you triedprompt=consent
? – Marc LaFleurprompt=consent
instead ofprompt=admin_consent
. No difference in the original problem. The new scopes are still not present in the response body nor the JWT token. – keystone