Skip to main content

OAuth 2.0

Status: Scaffold — content in progress

OAuth 2.0 is an authorization framework that allows a client to obtain limited access to a resource on behalf of a user. In Entra ID, OAuth2 is the foundation for all Microsoft 365 API access and third-party app integrations.

Grant Types (Flows)

FlowUse CaseAttack Risk
Authorization CodeWeb apps (with PKCE for SPA/mobile)Redirect URI abuse, token interception
Client CredentialsService-to-service (no user)Secret/certificate theft → impersonate app
Device CodeDevices without browsersDevice code phishing
ImplicitDeprecated; browser-basedToken leakage in URL fragment
Resource Owner PasswordLegacy; not recommendedPhishing to collect credentials directly

Tokens

TokenLifetimeContents
Access Token60–90 minScopes, user claims, audience
Refresh Token90 days (configurable)Used to get new access tokens
ID TokenShortIdentity claims (OIDC)

Key Attack Insight: Stealing a refresh token gives attacker persistent access that survives password resets until the token expires or is revoked.

Scopes and Permissions

TypeDefined ByExamples
Delegated permissionsApp + userUser.Read, Mail.ReadWrite
Application permissionsApp only (no user)Mail.Read for all users in tenant

Illicit Consent Grant exploits the consent mechanism: attacker creates a malicious app, phishes a victim to consent to broad permissions (e.g., Mail.ReadWrite), then accesses data via the app's delegated permissions.

Telemetry

LogSignal
Entra Sign-in logsOAuth flow used, client app ID, resource, scopes
Entra Audit logsApp consent events, permission grants
Microsoft 365 Unified Audit LogOAuth token usage by app
TopicLink
Device Code Phishingdevice-code-phishing
Illicit Consent Grantillicit-consent-grant
OAuth Token Theftoauth-token-theft