๐Ÿ” Recipe ยท Entra ID & Identity

Troubleshoot AADSTS65001 Consent Required Errors for Enterprise Applications

Diagnose and resolve 'invalid_grant' consent errors by auditing OAuth2 permission grants and granting tenant-wide admin consent for missing resources

Complexity

Intermediate

Impact

access + troubleshooting + applications + consent + entra-id

Context

Why This Matters

The AADSTS65001 error ("The user or administrator has not consented to use the application") is one of the most common sign-in errors admins encounter with enterprise applications in Microsoft Entra ID. It typically surfaces when an application requests permissions (scopes) for a resource โ€” such as Microsoft Graph, SharePoint Online, or Exchange Online โ€” that have not yet been consented to by either the user or an administrator.

A frequent scenario: an admin grants tenant-wide consent for an app's Microsoft Graph permissions, but the same app also requires permissions for a different resource (like SharePoint Online), and that second resource was never consented to. Users then hit invalid_grant errors the moment the app tries to obtain a token for the un-consented resource.

Run this recipe when:

  • A user reports AADSTS65001 or invalid_grant errors in a browser, Teams app, or partner SaaS tool.
  • An app previously worked but started failing for a specific feature (e.g., SharePoint file access, mailbox reads).
  • You've granted admin consent but some scopes still prompt users individually.
  • Tenant-wide user consent is restricted and the app requires admin approval.

Expected Outcomes

After completing this recipe you will have:

  • Identified the exact application (appId), service principal, and affected user causing the consent failure.
  • Enumerated all existing OAuth2 delegated permission grants for the app (per-user and tenant-wide).
  • Identified which resource (Microsoft Graph, SharePoint Online, Exchange, etc.) is missing consent.
  • Reviewed the tenant's authorizationPolicy to determine whether users are even permitted to grant consent themselves.
  • Granted admin consent for the missing resource or documented why consent cannot be granted.
  • Verified the user can successfully sign in and use the application's affected features.

Risks & Considerations

โš ๏ธ Risks & Gotchas

  • Do not blindly grant admin consent. Review every requested scope. Permissions like Directory.ReadWrite.All, Mail.ReadWrite, or Sites.FullControl.All give the app broad tenant-wide capabilities that cannot be scoped to specific users after the fact.
  • Verify publisher trust. Confirm the app's publisher domain and Microsoft verified publisher status before consenting. Malicious apps frequently impersonate legitimate brands.
  • Consent-phishing risk. If the user arrived at the consent prompt via an email link rather than by launching the app from your SSO portal, treat it as a potential phishing attempt until proven otherwise.
  • Tenant-wide consent is hard to undo at scale. Removing a granted permission requires revoking the oauth2PermissionGrant object and, for app-only permissions, the appRoleAssignment. Users with cached tokens may continue using the app for up to an hour.
  • Compliance: Some regulated environments (HIPAA, FedRAMP, SOX) require a change-management ticket and approval before granting new application permissions. Check your org's policy before clicking "Grant admin consent".
  • Don't reset the user's password or MFA โ€” this is an application consent issue, not a user authentication issue.

Required Permissions

PermissionWhy It's Needed
User.Read.AllResolve the affected user's object ID and validate account state.
Application.Read.AllRead service principal metadata for the application with the consent issue.
DelegatedPermissionGrant.ReadWrite.AllRead existing oauth2PermissionGrants and create new grants to resolve missing consent.
AppRoleAssignment.ReadWrite.AllManage application-role (app-only) assignments when admin consent is required.
Policy.Read.AllRead the tenant authorizationPolicy to determine whether user consent is permitted.
AuditLog.Read.AllRead sign-in logs and directory audit logs to correlate the consent failure to a specific user and app.
Directory.Read.AllLook up resource service principals (Microsoft Graph, SharePoint Online, Exchange) by appId.

The fastest way to get this done โ€” just ask Dex. Copy the prompt below and paste it into your Dex conversation.

For IT Admins

Paste into Dex CoAdmin

{user} is getting AADSTS65001 'consent required' / invalid_grant error when using application {app_id} (correlation ID {correlation_id}). Investigate which resource is missing consent by checking sign-in logs and existing oauth2PermissionGrants, then recommend or apply tenant-wide admin consent for the minimum required scopes.
Try in Dex CoAdmin

For End Users

How an employee would ask Dex for help

I'm getting an error that says 'consent is required' when I try to use one of our company apps. Can you help me get access?
Try in Dex Playground