Build integrations · Public
OpenID Connect integration reference
Integrate enterprise applications with ONE discovery, Authorization Code with PKCE, ID tokens, UserInfo, and rotating refresh tokens.
This reference covers OIDC applications registered for an enterprise organisation. Register the application and obtain its configuration URLs using Configure OpenID Connect applications.
Use {issuer} below as a placeholder for the exact issuer displayed in IAM → SSO → OIDC Apps → Configuration URLs. OIDC endpoints do not use the IDMS /api base URL. All examples below use placeholders for credentials and tokens.
Discovery and signing keys
Use an OIDC library where possible. Discovery advertises Authorization Code (response_type=code), PKCE S256, RS256 ID token signatures, and supported client authentication methods. Do not infer support for implicit flow, password grants, dynamic registration, logout, introspection, or revocation endpoints; these are not advertised.
| Method | Endpoint | Purpose |
|---|---|---|
| GET | {issuer}/.well-known/openid-configuration |
Read provider configuration |
| GET | {issuer}/oauth/jwks |
Retrieve public signing keys |
| GET | {issuer}/oauth/authorize |
Start browser authorization |
| POST | {issuer}/oauth/token |
Exchange codes or refresh tokens |
| GET or POST | {issuer}/oauth/userinfo |
Read identity claims using a Bearer access token |
1. Start browser authorization
Generate fresh, unpredictable state and nonce values and retain them with the login transaction. Generate a cryptographically random PKCE verifier of 43–128 allowed characters. The challenge is BASE64URL(SHA256(ASCII(code_verifier))), without padding.
GET {issuer}/oauth/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=URL_ENCODED_CALLBACK&scope=openid%20profile%20email%20offline_access&state=RANDOM_STATE&nonce=RANDOM_NONCE&code_challenge=S256_CHALLENGE&code_challenge_method=S256
| Parameter | Requirement |
|---|---|
response_type |
Must be code |
client_id |
Registered Client ID |
redirect_uri |
Exact registered HTTP/HTTPS callback without a fragment |
scope |
Space-separated allowed scopes; must include openid |
state |
Use a fresh value and verify it at the callback; maximum 2,048 characters |
nonce |
Use a fresh value and compare it with the ID token; maximum 2,048 characters |
code_challenge |
Required for public clients and registrations requiring PKCE |
code_challenge_method |
Must be S256 when a challenge is supplied |
claims |
Optional JSON object containing id_token and/or userinfo claim requests; maximum 10,000 characters |
ONE signs the member into the accessible organisation and asks for consent. Members need the oidc:auth permission. Pending authorization expires after five minutes. On approval, ONE redirects to the registered callback:
REGISTERED_CALLBACK?code=ONE_TIME_CODE&state=RANDOM_STATE
On denial, the callback receives error=access_denied and the original state. Validate state for both success and error callbacks. Invalid requests may produce JSON errors rather than redirecting to an untrusted callback.
2. Exchange the code
Send a form-encoded POST to the token endpoint immediately. The redirect_uri must match the authorization request exactly. Send the original verifier, not the challenge.
POST {issuer}/oauth/token
Content-Type: application/x-www-form-urlencoded
Authorization: Basic BASE64_OF_URLENCODED_CLIENT_ID_COLON_URLENCODED_SECRET
grant_type=authorization_code&code=ONE_TIME_CODE&redirect_uri=URL_ENCODED_CALLBACK&code_verifier=ORIGINAL_VERIFIER
Confidential clients can alternatively send client_id and client_secret in the form body (client_secret_post). Public enterprise clients send client_id in the form body and omit the secret (none); PKCE is mandatory.
{
"access_token": "OPAQUE_ACCESS_TOKEN",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "OPAQUE_REFRESH_TOKEN",
"id_token": "SIGNED_JWT",
"scope": "openid profile email offline_access"
}
ONE's current code exchange returns a refresh token. Request offline_access when the integration intends to retain it for continued access. expires_in is the access token's remaining lifetime in seconds. Token responses have Cache-Control: no-store. Access and refresh tokens are opaque; do not parse them as JWTs or treat them as ID tokens.
3. Validate the ID token
Use the discovery document and JWKS to validate the token before creating an application session.
| Check | Required behaviour |
|---|---|
| Signature | Verify RS256 with the matching kid from JWKS; reject unexpected algorithms |
iss |
Exact configured issuer |
aud |
Your registered Client ID |
exp |
Must not have expired; use only a small clock tolerance |
nonce |
Must equal the nonce retained for this login transaction |
sub |
Persist as the member identifier together with iss |
The subject is stable within the enterprise tenant and differs across tenants. Do not use email as an immutable account identifier. auth_time records the time ONE issued the authorization code; it is not proof of a new credential challenge at that moment. ONE may reuse an existing browser login. Do not depend on prompt or max_age to force fresh authentication; these controls are not currently implemented.
Identity scopes add these claims to ID tokens and UserInfo:
| Scope | Claims |
|---|---|
openid |
sub; ID tokens also include protocol claims such as iss, aud, exp, iat, and auth_time |
profile |
preferred_username, name, given_name, family_name |
email |
email, email_verified |
ONE currently sets preferred_username to the primary email and email_verified according to active account status. Optional claims requests can ask for supported identity claims in either response location; ONE does not implement every OIDC claims constraint or essential-claim semantic. Use scopes for the ordinary integration path.
4. Read UserInfo
GET {issuer}/oauth/userinfo
Authorization: Bearer OPAQUE_ACCESS_TOKEN
Accept: application/json
{
"sub": "STABLE_SUBJECT",
"email": "[email protected]",
"email_verified": true,
"preferred_username": "[email protected]",
"name": "Example Member",
"given_name": "Example",
"family_name": "Member"
}
Claims depend on the granted scopes and supported requested claims. Verify that the returned sub matches the validated ID token. Expired or unavailable authorization returns HTTP 401 with invalid_token. OIDC access tokens authenticate these OIDC resources; they do not replace SAPP API credentials or CAS sessions.
5. Refresh tokens
Use the same token endpoint and client authentication method used for code exchange.
Public enterprise clients omit client_secret. A successful response contains new access, refresh, and ID tokens. Atomically replace the stored refresh token and serialize refresh requests for each session. The previous token becomes invalid after one successful redemption; retrying it returns invalid_grant. The configured refresh lifetime applies to each newly issued refresh token. Expired tokens require a new browser authorization.
ONE rechecks membership and OIDC access permission during code exchange, refresh, and UserInfo. An application must still enforce its own authorization and session policy; an already validated ID token does not automatically end an application session when permissions change.
POST {issuer}/oauth/token
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token&client_id=CLIENT_ID&client_secret=CLIENT_SECRET&refresh_token=CURRENT_REFRESH_TOKEN
Errors
Errors include error_description where available. Authorization validation returns invalid_request for invalid scopes and PKCE parameters. Do not log codes, verifiers, secrets, access tokens, refresh tokens, or complete ID tokens.
| HTTP status | Error | Typical cause |
|---|---|---|
| 400 | invalid_request |
Missing fields, invalid authorization parameters, or unsupported grant |
| 401 | invalid_client |
Unknown client, wrong issuer host, disabled OIDC configuration, or invalid confidential secret |
| 400 | invalid_grant |
Expired/used code, incorrect verifier, callback mismatch, expired/used refresh token, or removed authorization |
| 400 | invalid_scope |
Token grant asks for unavailable scopes |
| 401 | invalid_token |
UserInfo token is invalid, expired, or authorization is unavailable |
Shared security signals
Enterprise discovery also advertises SSF configuration. Confidential enterprise clients may use client_credentials for ssf.read and ssf.manage; this grant is for security signal management, not member sign-in, and does not issue an ID token or refresh token. See Configure Apple Business for the supported integration workflow.