code back on your redirect URI, and exchanges that
code for tokens at your program’s token URL.
Both URLs and your client id come from Orenda and are
different for every program.
Only the authorization code flow is enabled. The implicit and password grants aren’t
available on any program.
1. Send the user to sign in
state: a random value you generate and check on the way back. It protects against cross-site request forgery. Always send it.code_challenge: PKCE. Required for public clients (mobile, single-page apps), which get no client secret. Generate a randomcode_verifier, send its SHA-256 hash base64url-encoded as the challenge, and keep the verifier for step 3.redirect_uri: must match the one registered for your program exactly, including scheme, host, port, and path.
Skipping the provider chooser
By default the user sees a screen listing the available sign-in options. If your program has one identity provider and you want to skip that screen, add its name:2. Handle the redirect
The user signs in with your identity provider and lands back on your redirect URI:state matches before you do anything else. If it doesn’t, drop the response.
On failure you get ?error=…&error_description=… instead. Show the user a retry. It isn’t
a server outage.
3. Exchange the code for tokens
code_verifier, as HTTP Basic auth
(Authorization: Basic base64(client_id:client_secret)).
4. Call the API
Same as any other program. The access token is the bearer token:Lifetimes and refreshing
To refresh, post to the same token URL:
Refresh example
Signing out
Clear the tokens you hold, then send the user to your program’s logout URL to end the session at the identity layer. Clearing tokens alone isn’t a sign-out: the next authorization request signs the user straight back in from their provider session.logout_uri is where the user lands afterwards. It has to be one of the sign-out URLs
registered for your program, the same way redirect_uri has to be registered for sign-in.