OAuth Login Flow (Sequence)

DiagramEngineering · Authentication DesignMade from one prompt
Read-only preview

The prompt

Map out the OAuth login flow for our app

Make your own version

About the framework

Trace the successful sign-in exchange

The sequence follows User, Browser, Backend API, OAuth Provider, and DB through 12 messages. It starts with Sign in with Google, moves through authorization and consent, then returns an authorization code to the browser. The browser posts to /auth/callback, and the backend exchanges the code for access and ID tokens.

The final messages upsert a user record, return the user object, set a session cookie, and redirect to the dashboard. This is a successful-path sketch: the example contains no denial, validation-failure, or expired-session branches.

Adapt the participant names and callback messages to your implementation. Add the checks and failure cases you need to discuss explicitly, rather than treating this short interaction diagram as a complete authentication specification.

What's included

What you get

  • Five participants spanning the user, browser, backend, provider, and database
  • Twelve messages from Google sign-in to dashboard redirect
  • An authorization-code exchange returning access and ID tokens
  • User-record upsert and session-cookie messages
Diagram

OAuth Login Flow (Sequence)

authoauthsequencetechnicalbackend

✦ Free preview · Sign in to use

Frequently asked questions

Common questions

Does the example show failed logins?

No. It follows one successful login from the sign-in click to the dashboard. Ask for alternate branches covering the specific errors your implementation handles.

Where is the user record created or updated?

After the token response, the Backend API sends an Upsert user record message to DB. DB returns a user object before the API sets the browser’s session cookie.

Does this specify every authentication check?

No. The messages omit implementation details and validation steps. Add those from your application’s authentication design before using the diagram for an engineering review.

OAuth Login Flow (Sequence)

Free to start. No credit card required.

Free preview · Sign in to use