Choose the right OAuth Grant Type

How the token will be retrieved?

User Log In

User log in and may consent through an interface.

No User Interaction

No user interaction is needed. The application runs in the background or as a service.

All OAuth 2.0 & OIDC Grant Types

Explore detailed sequence diagrams, HTTP flows, security best practices, and RFC specifications for every OAuth 2.0 and OpenID Connect grant type.

Confidential ClientsAuthorization Code

Authorization Code Flow

The foundational OAuth 2.0 flow designed for confidential clients that can safely store credentials on a backend server.

#oauth2#authorization-code#oidc
View flow
Recommended StandardPKCE

Authorization Code Flow with PKCE

The modern standard login flow recommended for Single Page Apps (SPAs), Mobile apps, and Native clients, mitigating authorization code interception and injection attacks.

#oauth2#pkce#authorization-code
View flow
Machine-to-MachineClient Credentials

Client Credentials Flow

Direct server-to-server authorization for machine-to-machine (M2M) communications, microservices, daemons, and automated jobs without end-user interaction.

#oauth2#client-credentials#machine-to-machine
View flow
Token RenewalRefresh Token

Refresh Token Flow

Renew expired access tokens seamlessly in the background without forcing the user to re-authenticate or re-enter credentials.

#oauth2#refresh-token#token-renewal
View flow
Input-Constrained DevicesDevice Code

Device Authorization Flow

Designed for internet-connected devices that either lack a browser or have severely restricted text input, such as Smart TVs, media encoders, IoT devices, and CLI terminals.

#oauth2#device-code#smart-tv
View flow
DeprecatedImplicit

Implicit Flow

A legacy browser flow where access tokens were returned directly in the URL hash fragment. Deprecated due to token leakage vulnerabilities; use Authorization Code with PKCE instead.

#oauth2#implicit#deprecated
View flow
Enterprise FederationJWT Bearer

JWT Profile / Bearer Token Flow

Secure server-to-server authorization using cryptographically signed JSON Web Tokens (assertions) as authorization grants or client authentication credentials.

#oauth2#jwt-bearer#rfc7523
View flow
Deprecated - InsecurePassword (ROPC)

Resource Owner Password Credentials Flow

Legacy flow where the end-user provides their plaintext username and password directly to the client application. Removed in OAuth 2.1 due to severe security risks.

#oauth2#password#ropc
View flow