SequenceAPI workflowSimple
OAuth 2.0 authorization code flow
Standard OAuth 2.0 authorization code exchange between user, app, and identity provider.
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
1sequenceDiagram2 participant U as User3 participant A as App4 participant IdP as Identity Provider5 participant API as Resource API67 U->>A: Click "Sign in"8 A->>IdP: Redirect to /authorize9 IdP->>U: Login and consent10 U->>IdP: Approve11 IdP-->>A: Redirect with code12 A->>IdP: POST /token (code + secret)13 IdP-->>A: access_token + refresh_token14 A->>API: Request with access_token15 API-->>A: Protected resourceRelated
Related templates
More templates that cover similar workflows.