Teams still pick OAuth grants by copying whatever an old tutorial used, so password and implicit flows survive long after the standards dropped them. This reference lists every OAuth grant in common use, the specification that defines it, its position in the OAuth 2.0 Security Best Current Practice (RFC 9700) and in the OAuth 2.1 draft, and the situations where you should not use it. It is written for developers, identity architects and authorisation server owners who need to approve, review or retire client registrations. Status statements were checked on 27 November 2026: OAuth 2.1 is still an Internet-Draft (draft-ietf-oauth-v2-1-17, dated 31 October 2026), so treat its contents as likely direction, not a published standard.
Key takeaways
- Authorisation code with PKCE is the default for users. RFC 9700 requires PKCE for public clients and recommends it for confidential ones, and OAuth 2.1 builds the code grant around it.
- Client credentials is the grant for non-human identities. Pair it with asymmetric client authentication (private_key_jwt or mutual TLS), narrow scopes and short token lifetimes instead of long-lived shared secrets.
- Device authorisation is useful and phishable. RFC 8628 itself warns about remote phishing, and device code phishing has been used in real campaigns; block it where it is not needed.
- Implicit and password grants are retired. RFC 9700 says clients SHOULD NOT use the implicit grant and the password grant MUST NOT be used; neither appears in the OAuth 2.1 draft.
- Extension grants need their own controls. Token exchange, JWT bearer and CIBA solve real problems but each needs client authentication, audience restriction and an owner who understands the trust it creates.
How to read this reference
A grant type is the method a client uses to obtain an access token from the token endpoint. RFC 6749 (2012) defined four grants and an extension mechanism: authorisation code, implicit, resource owner password credentials and client credentials, plus the refresh token grant used to renew tokens. Later RFCs and OpenID Foundation specifications added extension grants identified by URNs in the grant_type parameter.
- Specification: the document that defines the grant. RFCs are published standards; the OAuth 2.1 draft can still change.
- RFC 9700 position: the security BCP published in January 2025 as BCP 240. It updates RFC 6749 and is the current consolidated advice. See the OAuth 2.0 Security Best Current Practice (RFC 9700) Guide.
- OAuth 2.1 draft position: Section 1.3 of draft 17 defines three grants (authorisation code, refresh token and client credentials). Other grants are extensions. See the OAuth 2.1, GNAP and FAPI Guide.
- Avoid when: conditions under which the grant is the wrong choice even if the specification allows it.
Grant types at a glance
| Grant | grant_type value | Specification | RFC 9700 / OAuth 2.1 draft | Typical use | Avoid when |
|---|---|---|---|---|---|
| Authorisation code (with PKCE) | authorization_code | RFC 6749 s4.1, PKCE RFC 7636 | Recommended; PKCE MUST for public clients / core grant | Web, single-page, native and mobile apps acting for a user | No user is present (use client credentials) |
| Refresh token | refresh_token | RFC 6749 s6 | Public client refresh tokens MUST be sender-constrained or rotated / core grant | Renewing access without a new user interaction | Long-lived bearer refresh tokens on public clients |
| Client credentials | client_credentials | RFC 6749 s4.4 | Allowed; asymmetric client authentication recommended / core grant | Service to service, jobs, workloads, agents acting as themselves | The call is on behalf of a user |
| Device authorisation | urn:ietf:params:oauth:grant-type:device_code | RFC 8628 | Not a BCP topic beyond CSP on the device endpoint / extension | TVs, CLIs, input-constrained devices | The device has a browser, or the flow is not needed at all |
| Token exchange | urn:ietf:params:oauth:grant-type:token-exchange | RFC 8693 | Allowed / extension | Delegation and impersonation across services, downscoping | Used as a general token converter without policy |
| JWT bearer | urn:ietf:params:oauth:grant-type:jwt-bearer | RFC 7523 | Allowed / extension | Trusted issuer asserts a subject, server-side integrations | The assertion issuer is not tightly controlled |
| SAML 2.0 bearer | urn:ietf:params:oauth:grant-type:saml2-bearer | RFC 7522 | Allowed / extension | Bridging SAML federations to OAuth APIs | New builds that can use OIDC and JWT |
| CIBA | urn:openid:params:grant-type:ciba | OpenID CIBA Core 1.0 (Final) | Not covered / extension | Call centre, point of sale, decoupled approval | No binding message can be shown to the user |
| Implicit | none (response_type=token) | RFC 6749 s4.2 | SHOULD NOT be used / removed | Legacy single-page apps | Always, for new work |
| Resource owner password credentials | password | RFC 6749 s4.3 | MUST NOT be used / not specified | Legacy first-party apps | Always |
Authorisation code with PKCE
The client sends the user's browser to the authorisation endpoint, receives a short-lived code at a registered redirect URI and exchanges it at the token endpoint. PKCE (RFC 7636) binds the code to the client instance: the client sends a code_challenge derived from a secret code_verifier and proves possession of the verifier at redemption.
- Requirements from RFC 9700 Section 2.1.1: public clients MUST use PKCE, confidential clients SHOULD, authorisation servers MUST support it, MUST enforce the verifier when a challenge was sent and MUST mitigate PKCE downgrade. Use
S256; it is the only method that does not expose the verifier. - Redirect URIs: exact string matching, no wildcards, and no plain
httpexcept loopback redirects for native apps. - Client type: single-page apps are public clients. Where tokens should not reach the browser, use a backend for frontend. See the OAuth for Browser-Based Applications and the BFF Pattern Guide and the OAuth for Native and Mobile Apps Guide.
- Avoid when: there is no user, or the client cannot open a browser or receive a redirect (consider device authorisation, with care).
The refresh token grant sits alongside the code grant. RFC 9700 Section 2.2.2 says refresh tokens for public clients MUST be sender-constrained or use refresh token rotation. See the OAuth Refresh Token Rotation and Expiry Guide and the DPoP Guide.
Client credentials
The client authenticates as itself and receives a token that represents the client, not a user. This is the main OAuth path for non-human identities: microservices, batch jobs, CI pipelines, integration platforms and AI agents that act under their own identity. See the Machine-to-Machine OAuth (Client Credentials) Guide.
| Decision | Weaker choice | Stronger choice |
|---|---|---|
| Client authentication | client_secret_basic or client_secret_post with a shared secret | private_key_jwt (RFC 7523) or mutual TLS (RFC 8705); RFC 9700 Section 2.5 recommends asymmetric methods |
| Credential source | Secret in a config file or environment variable | Workload identity federation or a platform-issued assertion, with no stored secret |
| Token binding | Bearer access token | Sender-constrained token (mTLS or DPoP, RFC 9449) |
| Scope | One client with broad scopes for many jobs | One client per workload, minimal scopes, audience-restricted tokens |
| Lifetime | Hour-long or longer tokens, secrets never rotated | Short token lifetimes, key rotation on a schedule with overlap |
- Subject confusion: RFC 9700 describes a client impersonating a resource owner. If a client can choose its own
client_idand that value can collide with a user identifier in thesubclaim, a resource server may treat a client token as a user token. Do not let clients choose identifiers in a shared namespace, and give resource servers a way to tell client tokens from user tokens. - Ownership: record a human owner, purpose and expiry for each client registration. Orphaned client credentials are standing access nobody reviews.
- Avoid when: the action is on behalf of a user. Using client credentials to act for users hides who authorised what; use the code grant or token exchange so the user stays in the token.
See the JWT Client Authentication (private_key_jwt) Guide and the Workload Identity Federation Guide.
Device authorisation
RFC 8628 serves devices that cannot run a browser or accept typed input easily. The device posts its client_id to a separate device authorisation endpoint and gets back a device_code, a short user_code, a verification_uri and an expires_in lifetime. The user visits the URI on a phone or laptop and enters the code while the device polls the token endpoint. If no interval is returned, clients must wait 5 seconds between polls, and a slow_down error adds 5 seconds to the interval.
- Remote phishing (RFC 8628 Section 5.4): an attacker can start the flow on a device they control and persuade a user to enter the code. The RFC recommends telling users they are authorising a device, asking them to confirm it is in their possession and showing device information. A short code lifetime reduces but does not remove the risk, because a real-time phisher can request a fresh code.
- Brute force (Sections 5.1 and 5.2): rate-limit user code attempts. The RFC's example 8-character base-20 code has about 34.5 bits of entropy. The device code is never shown to users and should have high entropy.
- Real-world abuse: Microsoft reported in February 2025 that the actor it tracks as Storm-2372 sent meeting invitations leading to genuine Microsoft device code sign-in pages, then used the resulting tokens to search and exfiltrate mail. Microsoft's mitigations included blocking device code flow where possible, revoking refresh tokens on suspected compromise and phishing-resistant MFA. See the Device Code Phishing Guide.
- Control: in Microsoft Entra ID the Conditional Access "Authentication flows" condition can block device code flow; Microsoft advises auditing use in report-only mode first and allowing it only for documented cases. See How to block device code flow with Conditional Access and handle the exceptions.
- Avoid when: the client can open a browser (use the code grant with PKCE), or the organisation has no input-constrained devices that need it.
Token exchange, JWT bearer and CIBA
Token exchange (RFC 8693)
A client presents a subject_token, and optionally an actor_token, and asks for a new token for a given audience or resource. RFC 8693 distinguishes impersonation, where the actor becomes indistinguishable from the subject, from delegation, where the token carries both and the act claim names the current actor. Nested act claims record a chain, but access decisions should use only the top-level claims and current actor. The RFC strongly recommends client authentication, because otherwise anyone with a stolen token could exchange it. This grant fits agent and microservice chains that must keep the user in context. See the OAuth Token Exchange and Delegation Guide.
JWT bearer (RFC 7523)
The client posts a signed JWT in the assertion parameter. The JWT must carry iss, sub, aud and exp; jti is optional, so replay protection is the server's choice. RFC 7523 also defines client authentication with client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer, which is the basis of private_key_jwt. Do not confuse the two: the grant asserts a subject, the client assertion authenticates the client. Restrict which issuers are trusted and which subjects each issuer may assert, and track jti to stop replay.
CIBA (OpenID Foundation, Final)
Client Initiated Backchannel Authentication lets a client on one device ask the provider to authenticate a user on another, such as a banking app approving a call centre transaction. The client sends exactly one of login_hint_token, id_token_hint or login_hint and may send a binding_message shown on both devices. Tokens arrive by poll, ping or push mode, chosen at registration. Push mode bypasses the client-authenticated token endpoint, so the notification endpoint needs strong protection. See the OIDC CIBA Guide and CIBA vs OAuth Device Flow.
Deprecated grants: implicit and password
| Grant | Why it was retired | Replacement | How to find it |
|---|---|---|---|
| Implicit | Access tokens returned in the front channel leak through browser history, referrers and logs, and can be injected; no client authentication or sender binding | Authorisation code with PKCE, or a BFF | Registrations allowing response_type=token or id_token token; authorisation logs with those response types |
| Resource owner password credentials | The client handles the user's password, which trains phishing behaviour, blocks MFA and federation, and gives the client the full credential | Authorisation code with PKCE for users; client credentials for services | Token endpoint requests with grant_type=password; clients configured to permit it |
RFC 9700 says clients SHOULD NOT use the implicit grant unless token injection is prevented and leakage is mitigated, and that the password grant MUST NOT be used. The OAuth 2.1 draft removes implicit and does not specify password. Migration steps are in the OAuth Implicit Flow Migration guide.
Monitoring grant use
- Grant mix: count token requests by
grant_typeand client each week; anypasswordor implicit traffic is a finding. - Device code use: alert on device code sign-ins from users or apps with no approved need, which is a sign of phishing.
- Client authentication method: percentage of confidential clients using
private_key_jwtor mTLS rather than secrets. - Token theft signals: token use from a new location or client shortly after issuance maps to MITRE ATT&CK T1528 Steal Application Access Token and T1550.001 Application Access Token.
- Orphaned clients: client registrations with no owner or no token requests in 90 days.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST CSF 2.0 | PR.AA-01, PR.AA-05 | Credentials for users and services are managed; permissions follow least privilege |
| NIST SP 800-53 Rev 5 | IA-5, IA-9, AC-6 | Authenticator management for client secrets and keys; service authentication; least privilege scopes |
| MITRE ATT&CK | T1528, T1550.001, T1566.002 | Token theft, use of stolen tokens, and phishing links used for device code phishing |
Practitioner checklist
- Inventory every client registration with its allowed grant types, client type, authentication method and owner.
- Disable the password grant and implicit response types on the authorisation server, after confirming no live traffic in logs.
- Require PKCE with
S256for all clients using the code grant and reject requests that downgrade it. - Move confidential and machine clients from shared secrets to
private_key_jwt, mutual TLS or workload identity federation. - Give each workload or agent its own client with minimal scopes and audience-restricted, short-lived tokens.
- Block device code flow by default and allow it only for named, documented use cases.
- Require client authentication for token exchange and JWT bearer, and define which subjects and audiences each client may request.
- Sender-constrain or rotate refresh tokens for public clients.
- Recheck the OAuth 2.1 draft status at each annual review and update this mapping when it is published.
Standards and references
- IETF: RFC 9700 Best Current Practice for OAuth 2.0 Security
- IETF: The OAuth 2.1 Authorization Framework (Internet-Draft)
- IETF: RFC 6749 The OAuth 2.0 Authorization Framework
- IETF: RFC 8628 OAuth 2.0 Device Authorization Grant
- IETF: RFC 8693 OAuth 2.0 Token Exchange
- IETF: RFC 7523 JWT Profile for OAuth 2.0 Client Authentication and Authorization Grants
- OpenID Foundation: Client Initiated Backchannel Authentication Core 1.0
- Microsoft Learn: Block authentication flows with Conditional Access
Related NHI Mgmt Group resources: OAuth 2.0 Security Best Current Practice (RFC 9700) Guide · Machine-to-Machine OAuth (Client Credentials) Guide · Device Code Phishing Guide · Authorisation Code vs Client Credentials Flow