Upstream provider callback
GET/oauth2/federation/callback
The provider returns here after login. Verifies state against the flow, exchanges the upstream code, validates the upstream id_token, finds or creates the ESP User account, and redirects to the client's redirect_uri with a single-use code. Upstream tokens are discarded.
Request
Responses
- 302
- 400
Redirect to the client's redirect_uri with code (+ state).
Response Headers
The __Host-esp_session cookie
(Path=/; HttpOnly; Secure; SameSite=Lax) establishing the
authorization server's own session, whose record inherits the
upstream's auth_time. It stores no token — an opaque revocable
identifier only. A session-layer failure never blocks the login
itself.
State/flow mismatch, a missing or different __Host-esp_flow_id cookie, or upstream validation failure (HTML error page; no cookie is set).