Use cases

This documentation was generated with the assistance of AI. Please report any inaccuracies.

The pages in this section walk through each OAuth 2.0 / OpenID Connect flow the example implements, step by step. Each page names the actors and the clients involved, what must be configured first, the endpoints, the tokens and claims it returns and the tests that exercise it, and shows the exchange as Mermaid sequence diagrams (with a flowchart where the flow branches). Each one links to the official specification and to the matching page of the OAuth Reference in the Irurueta Docs site, which explains the protocol itself; these pages explain how this example implements it.

A use case here is a protocol flow, not one of the *UseCase classes of the application modules: one flow usually runs several of them.

Which flow for which client

flowchart TD Start(["Who needs a token?"]) --> User{"Is a user present?"} User -- "yes" --> Browser{"Does the client run in a browser?"} Browser -- "yes, behind a backend" --> BFF["Authorization code + PKCE through the BFF"] Browser -- "yes, JavaScript only" --> SPA["Authorization code + PKCE, public client"] Browser -- "no keyboard or browser" --> Device["Device authorization grant"] User -- "no, a service" --> Own{"Acting for itself?"} Own -- "yes" --> CC["Client credentials"] Own -- "no, on behalf of a user" --> TE["Token exchange"]

Flows

Use case Specification OAuth Reference

Authorization code + PKCE through the BFF

RFC 6749 §4.1, RFC 7636

Authorization Code & PKCE, Browser-Based Apps

Authorization code + PKCE for a public client

RFC 6749 §4.1, RFC 7636

Browser-Based Apps

Authentication methods inside the authorization code flow

RFC 6238, WebAuthn, RFC 8176

Authentication Methods: Passwordless & 2FA

Step-up authentication

RFC 9470, OIDC Core §3.1.2.1

Authentication Methods: Passwordless & 2FA

Social login and identity brokering

OpenID Connect Core

Social Login & Federation

OpenID Connect: ID token, UserInfo, discovery and JWKS

OIDC Core, OIDC Discovery, RFC 8414

OpenID Connect

Refresh token rotation and reuse detection

RFC 6749 §6, RFC 9700

Access & Refresh Tokens

Logout

OIDC RP-Initiated Logout

Logout & Session Management

Pushed authorization requests

RFC 9126

PAR, JAR & Hardened Profiles

Legacy implicit flow (demo only)

RFC 6749 §4.2, RFC 9700

Legacy Grants: Implicit & Password

Client credentials

RFC 6749 §4.4

Client Credentials & Client Authentication

Client authentication

RFC 7523, RFC 8705, OIDC Core §9

Client Credentials & Client Authentication

Sender-constrained tokens: DPoP and mTLS

RFC 9449, RFC 8705 §3

Sender-Constrained Tokens: DPoP & mTLS

Token exchange

RFC 8693

Token Exchange & Assertion Grants

Device authorization grant

RFC 8628

Device Authorization Grant

Dynamic client registration

OIDC Dynamic Registration, RFC 7591

Discovery, Metadata & Client Registration

Token validation at the resource server

RFC 6750, RFC 7662, RFC 7009

Opaque Tokens, Introspection & Revocation

The password, passkey, one-time code, social and certificate sign-ins are not OAuth grants: they are how the user authenticates inside the authorization code flow, between the authorization request and the code being issued, and are described together in Authentication methods inside the authorization code flow. The feature pages (for example Multi-factor authentication and step-up or X.509 client certificates) describe how each piece is built.