SequenceAPI workflowSimple

OAuth 2.0 authorization code flow

Standard OAuth 2.0 authorization code exchange between user, app, and identity provider.

OAuth 2.0 authorization code flow preview

What this diagram shows

Step 01
Authorize redirect

App sends the user to the identity provider for login and consent.

Step 02
Code exchange

App trades the short-lived code for an access token using its client secret.

Step 03
Protected call

App uses the access token to call the resource API on the user's behalf.

About sequence diagrams

Sequence diagrams show how participants exchange messages over time. They are a natural fit for API calls, authentication handshakes, and distributed flows where timing and order matter.

This template is written in Mermaid — plain text you can edit, version in git, and regenerate the image from any time.

View Mermaid sourcePlain-text diagram syntax — copy or edit directly.
diagram.mmd
1sequenceDiagram
2 participant U as User
3 participant A as App
4 participant IdP as Identity Provider
5 participant API as Resource API
6
7 U->>A: Click "Sign in"
8 A->>IdP: Redirect to /authorize
9 IdP->>U: Login and consent
10 U->>IdP: Approve
11 IdP-->>A: Redirect with code
12 A->>IdP: POST /token (code + secret)
13 IdP-->>A: access_token + refresh_token
14 A->>API: Request with access_token
15 API-->>A: Protected resource