Skip to content

Completes a login: validates the callback, exchanges the code, resolves

GET
/auth/callback
curl --request GET \
--url http://localhost:3001/auth/callback \
--header 'Authorization: Bearer <token>'

(or provisions) the principal, and mints a session.

Every failure path here ends in a clean ApiError and no session: a provider error, a missing/expired flow cookie, a state mismatch, an exchange/token failure, ClaimRejected, and SubjectNotAvailable (the latter two both map to 403 — see ResolveOutcome) all return before create_session is ever called.

code
required
string
nullable
state
required
string
nullable
error
required
string
nullable

Login completed; session cookie set, redirects to the validated return_to (default /)

Malformed callback, or a missing/expired/mismatched login flow

The provider rejected the login, or the exchanged token failed verification

The claim gate rejected the identity, or the subject belongs to a non-human or disabled principal

The identity provider was unreachable