A cloud-based identity and access management service for securing user authentication and resource access
In the Microsoft identity platform, the OAuth 2.0 On-Behalf-Of (OBO) flow always uses the .default model for downstream APIs, and that drives how consent works.
Key points from the platform behavior:
- OBO requires
.defaultfor the downstream resource- For OBO, the middle-tier API must request scopes using the
.defaultpattern for the downstream API, not individual delegated scopes likeUser.ReadBasic.All. - This is explicitly called out: “Its use is required in the On-Behalf-Of flow and client credentials flow.”
- For Microsoft Graph, the middle tier should request
scope=https://graph.microsoft.com/.default, notUser.ReadBasic.Alldirectly.
- For OBO, the middle-tier API must request scopes using the
-
.defaultuses preconfigured permissions on the calling app-
.defaultmeans “all permissions this application has been granted for this resource,” based on the app registration’s configured API permissions and the consent already granted. - For Graph, that means whatever Graph delegated permissions are configured on the middle-tier API’s app registration and have been consented (user or admin, depending on the permission’s policy).
-
- Consent type is determined by the permission, not by OBO
- Whether admin consent is required is determined by the Graph permission itself and tenant policy, not by the fact that OBO is used.
- The OBO call will fail with
AADSTS65001if the middle-tier app does not yet have consent for the requested Graph permissions.
- Why admin consent was required in the scenario
- The error message shows the middle-tier app (
Customer Portal API - Build a Doc) did not yet have consent for the requested Graph resource. - When the OBO token request was made, Entra ID evaluated the Graph permissions configured for that app (via
.default) and found that the required consent had not been granted. - Because the OBO flow is non-interactive (no user prompt at that point), and the permission set required admin consent in that tenant configuration, the call failed until an admin granted consent.
- The error message shows the middle-tier app (
- Why user consent cannot be used at OBO time
- In OBO, the middle-tier service is calling the token endpoint without user interaction. There is no way to show a consent screen at that moment.
- Any user consent must be obtained earlier, during an interactive sign-in flow where the client app requests consent for itself and the middle tier using
.defaultand known client applications.
- Correct pattern to avoid extra admin prompts (but not admin policy)
- Configure the client as a known client application of the middle-tier API and use
.defaultwhen the user signs in, as described in “Gaining consent for the middle-tier application.” - Example:
scope=openid https://middle-tier-api.example.com/.defaultduring the interactive sign-in. - This combined consent flow prompts the user once for:
- Client → middle-tier API permissions, and
- Middle-tier API → downstream APIs (like Graph) permissions.
- However, if any of those downstream permissions (for example, certain Graph permissions) are marked as “admin consent required” in the service or by tenant policy, an admin must still grant them. OBO cannot bypass that requirement.
- Configure the client as a known client application of the middle-tier API and use
- Implications for
User.ReadBasic.All- The platform documentation states that
.defaultis required for OBO and that static (.default) and dynamic scopes cannot be combined. - Therefore, the middle-tier cannot dynamically request only
User.ReadBasic.Allin OBO; it must requesthttps://graph.microsoft.com/.defaultand rely on the app’s preconfigured Graph permissions. - Whether
User.ReadBasic.Allcan be consented by users or requires admin consent is controlled by Graph’s permission model and tenant settings. If the tenant or Graph marks it as requiring admin consent, there is no supported workaround in OBO to avoid admin consent.
- The platform documentation states that
Summary:
- OBO itself does not inherently force admin consent, but it requires
.default, which uses preconfigured permissions on the middle-tier app. - If those permissions (such as Graph’s
User.ReadBasic.Allvia.default) require admin consent in the tenant, the OBO token request will fail until an admin grants consent. - There is no supported way in OBO to let users dynamically self-consent to new downstream Graph permissions at token-exchange time. The only options are:
- Obtain combined consent up front using
.defaultand known client applications, and - Have an admin grant any permissions that are admin-only in the tenant.
- Obtain combined consent up front using
References:
and click on Yes for was this answer helpful. And, if you have any further query do let us know.