SequenceDiagrams

Examples

OAuth 2.0 Sequence Diagram

This example shows the OAuth 2.0 authorization code flow as a sequence diagram. It traces the handoff from user consent to code exchange, then shows the app using the access token to request a protected resource.

OAuth 2.0 Authorization Code FlowUserAppAuthAPIClick sign inAuthorization requestLogin and consentApprove accessAuthorization codeExchange code and secretAccess tokenRequest with tokenProtected resource

Diagram source

Use this text as a starting point or open it in the editor to make changes.

title: OAuth 2.0 Authorization Code Flow
User -> App: Click sign in
App ->> Auth: Authorization request
Auth --> User: Login and consent
User -> Auth: Approve access
Auth ->> App: Authorization code
App -> Auth: Exchange code and secret
Auth --> App: Access token
App -> API: Request with token
API --> App: Protected resource