The standard OIDC flow for confidential clients (traditional server-rendered web applications such as
Node.js, Python, .NET, Java, or Next.js server components). The client uses a private client_secret
stored securely on the backend server to prove its identity during token redemption.
Unlike public clients (SPAs), confidential web applications possess a private backend server. This architecture splits the flow cleanly into two distinct communication channels:
GET /authorize):
The user clicks "Sign In" in your application. The browser redirects to the IdP's login portal with
response_type=code, client_id, and a cryptographic
state token. The user enters credentials, performs MFA, and grants requested permissions.
redirect_uri, passing an ephemeral authorization code in the query string.
This code is single-use and expires in minutes.
POST /token):
Your backend web application intercepts the incoming code and initiates a direct, machine-to-machine HTTPS POST to the IdP's
token endpoint, authenticating itself with its private client_secret.
id_token and extracts user profile claims
(sub, email, name) to initialize the local user session.
Configure your confidential application credentials. The client secret is transmitted strictly to our serverless
proxy (/api/token-exchange) to execute the token POST and is never saved in persistent storage.
openid requests the ID Token; profile and email request identity claims.
The user's browser redirects to the IdP's authorization endpoint. Unlike PKCE, no code_challenge
is passed in the URL because the confidential client's private secret will prove its identity directly at the token endpoint.
// Fill in config above
Following user authentication, the IdP redirects back to the redirect_uri with a short-lived
code in the query string. In a real application, this code is caught by your server-side route handler.
// Awaiting redirect from IdP…
Your backend sends the authorization code, client ID, and private client secret in an HTTP POST to the IdP's token endpoint.
Our proxy (/api/token-exchange) simulates this server-to-server call and returns the exact HTTP wire log.
// Preview will appear after IdP redirect
Exact HTTP Request sent by Backend to IdP
// Will appear after exchange
IdP Token Response
// Awaiting token exchange…
Explore the contents of the returned tokens. The id_token contains verified user identity claims,
while the access_token authorizes server-side API requests.