SSO Integration Guide
Related: Agent API Integration Guide (Bearer on agent routes) · API Reference Integration Guide
Sign your users in through your identity provider (IdP) on your website and obtain Lincoln Cannon LLC ID tokens for API calls. Users see your login UI—not a separate Lincoln Cannon LLC login page as the primary experience.
Your backend stores id_token and refresh_token and sends Authorization: Bearer <id_token> to Lincoln Cannon LLC APIs that support user-scoped access. Product-specific API keys, routes, and Bearer rules are provided with your integration package.
For the chat widget embed (Connect, BFF token hooks, open behavior), see Agent API Integration Guide.
1. What Lincoln Cannon LLC provides
Your integration contact supplies:
| Value | Used for |
|---|---|
client_id | OAuth authorize and token requests (SSO integration client your contact provides — distinct from any Lincoln Cannon LLC website login client) |
| OAuth domain | Authorize and token endpoints (see Environments below) |
identity_provider | Required on the authorize URL so users go to your IdP — Lincoln Cannon LLC assigns this after federation is configured; do not invent the string |
redirect_uri | Your HTTPS callback URL, registered in advance (exact match required) |
Keep refresh tokens on your server. Do not expose them in browser JavaScript or other untrusted clients.
Typical token lifetimes: ID token about 60 minutes; refresh token about 30 days (subject to change—refresh before expiry).
2. What you provide (onboarding)
Send these to your Lincoln Cannon LLC integration contact before you expect authorize/token to work with identity_provider. Until federation is configured, you will not yet have an identity_provider value.
Outbound federation required. Lincoln Cannon LLC federates to your identity system as a standard OIDC or SAML 2.0 provider (§2.2 or §2.3). Your IdP must expose the endpoints and credentials those protocols require (issuer / metadata, authorize and token or SAML assertion flow, and an application client_id / secret or SAML metadata as applicable).
Products that only issue signed session JWTs (and a JWKS for verifying those sessions), without acting as an outbound OIDC or SAML IdP, are not sufficient by themselves. Lincoln Cannon LLC APIs accept Lincoln Cannon LLC ID tokens only — not your session JWTs verified via your JWKS. In that case, run a small OIDC (or SAML) bridge you control that authenticates users through your existing session system and supplies the deliverables below (including email, verified email, display name, and a stable subject), or use a different IdP that supports outbound OIDC/SAML federation.
Inbound enterprise connections on your IdP (where your product consumes an external SAML IdP) are the opposite direction and do not replace outbound federation to Lincoln Cannon LLC.
2.1 Product callback (always)
| Item | Notes |
|---|---|
HTTPS product redirect_uri(s) | Exact callback URL(s) on your site where the browser returns with ?code=… (for example https://www.example.com/api/oauth/callback). Lincoln Cannon LLC registers each URL character-for-character. Optional localhost URLs for local development only if agreed with your contact. |
This is not the same URL as the IdP-application callback in §2.2 / §2.3.
2.2 OpenID Connect (OIDC) IdP
If your IdP is OIDC (Okta, Auth0, Azure AD OIDC, Cognito as OIDC, etc.), provide:
| Item | Notes |
|---|---|
| Issuer URL | Your IdP’s OIDC issuer (discovery base), for example https://cognito-idp.<region>.amazonaws.com/<pool-id> or your Okta/Auth0 issuer |
IdP application client_id | Confidential client (or equivalent) that Lincoln Cannon LLC will use to talk to your IdP |
IdP application client_secret | Send only over a secure channel your contact agrees to — not ordinary email, chat, or tickets |
| Scopes | Must include openid, email, and profile (or equivalent claims) |
| IdP-application callback allowlist | On your IdP app, allow: https://user.lincolncannon.co/oauth2/idpresponse (production). This is Lincoln Cannon LLC’s federation callback — not your product redirect_uri |
Confirm your IdP can issue the profile claims in §5 (email, verified email, display name, and a stable unique subject such as OIDC sub).
2.3 SAML 2.0 IdP
If your IdP is SAML instead of OIDC, provide:
| Item | Notes |
|---|---|
| IdP metadata | HTTPS metadata URL, or a metadata file your contact accepts |
| Attribute names | Exact claim/attribute names for email, verified-email indicator (if available), display name, and stable NameID / subject |
| ACS / callback allowlist | On your IdP, allow Lincoln Cannon LLC’s SAML assertion consumer URL: https://user.lincolncannon.co/saml2/idpresponse (production) — again not your product redirect_uri |
2.4 After your contact finishes setup
You receive the integration package values in §1 (including identity_provider). Then implement the OAuth flow in §4.
3. When sign-in runs
Typical: The user is already signed in on your site and opens a feature that needs a Lincoln Cannon LLC token. Your application has no valid tokens yet and runs the OAuth redirect flow once.
Optional: Run the same flow during your login so the feature works on first use without an extra redirect.
Day-to-day: Your backend sends the current id_token on API requests. Refresh it server-side before expiry. Run the authorize flow again only when refresh fails.
4. OAuth flow (authorization code + PKCE)
Use a public client (no client secret). PKCE is required.
4.1 Generate PKCE values
code_verifier = high-entropy random string (43–128 chars, URL-safe)
code_challenge = BASE64URL(SHA256(code_verifier)) # method S256
Store code_verifier server-side until you exchange the authorization code.
4.2 Redirect the browser to authorize
When the user needs tokens, redirect to:
GET https://user.lincolncannon.co/oauth2/authorize
?client_id=<client_id>&response_type=code
&redirect_uri=https://your-app.com/auth/callback
&scope=openid+email+profile
&identity_provider=<identity_provider>&code_challenge=<code_challenge>&code_challenge_method=S256
Use the OAuth domain from your integration package if it differs from the production host above.
redirect_urimust match the URL Lincoln Cannon LLC registered for you character-for-character.identity_providermust be the value supplied in your integration package.- With
identity_providerset, the user is sent to your IdP, not a Lincoln Cannon LLC login chooser.
4.3 Handle the callback
Your callback receives:
GET https://your-app.com/auth/callback?code=<authorization_code>Exchange the code from your server:
POST https://user.lincolncannon.co/oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=authorization_code
&client_id=<client_id>&code=<authorization_code>&redirect_uri=https://your-app.com/auth/callback
&code_verifier=<code_verifier>Success (JSON):
{
"id_token": "…",
"access_token": "…",
"refresh_token": "…",
"expires_in": 3600,
"token_type": "Bearer"
}
Store id_token (short-lived) and refresh_token (long-lived) in your server session or secure store. Use id_token (not access_token) as the Bearer credential for Lincoln Cannon LLC APIs.
4.4 Refresh the ID token
Before the id_token expires:
POST https://user.lincolncannon.co/oauth2/token
Content-Type: application/x-www-form-urlencoded
grant_type=refresh_token
&client_id=<client_id>&refresh_token=<refresh_token>Replace the stored id_token (and refresh_token if a new one is returned).
5. Required user profile in the ID token
Your IdP must supply the claims below (mapped into the token Lincoln Cannon LLC issues). First sign-in fails if required data is missing—work with your integration contact to fix IdP claim mapping.
| Claim | Required |
|---|---|
sub | User id (issued by Lincoln Cannon LLC after federation) |
email | Yes |
email_verified | Yes — must be true |
name, or given_name + family_name | Yes — display name |
Optional: picture and other standard OpenID Connect profile claims.
If a user already has an account with the same email, sign-in links to that account so the same sub is used across methods.
Individual Lincoln Cannon LLC products may require additional claims (for example, verified email for certain user-bound features).
6. Error handling
| Situation | What to do |
|---|---|
id_token expired | Refresh (§4.4); if that fails, run authorize again (§4.2–4.3) |
OAuth error= on callback | Show your login error; do not call APIs without tokens |
Token exchange invalid_grant | Authorization code expired or PKCE mismatch — restart from §4.2 |
redirect_uri mismatch | Callback URL does not match registration — contact your integration contact |
| First sign-in fails for a user | Usually missing or unmapped IdP claims — contact your integration contact |
Common authorize errors: invalid_request, unauthorized_client, access_denied.
7. Security practices
- Run token exchange and refresh on your server (or BFF), not in untrusted front-end code.
- Use HTTPS for all production
redirect_urivalues. - Treat
id_tokenas a secret credential; refresh before expiry. - The Bearer token identifies the end user; use it together with each product’s API credentials and rules.
- Do not send IdP
client_secretvalues (or refresh tokens) over ordinary email or public channels — use the secure path your integration contact specifies (§2).
8. Environments
Production OAuth domain: https://user.lincolncannon.co
Your integration contact configures production OAuth (and related API bases) to match your production credentials. If they give you different OAuth domain, client_id, identity_provider, or redirect_uri values for a non-production setup, use those instead.
9. Support
For IdP setup, callback registration, claim mapping, or first-login failures, contact your Lincoln Cannon LLC integration contact.
First-time onboarding: send the items in §2 (product redirect_uri(s) plus OIDC or SAML IdP details). Do not invent identity_provider — your contact returns it after federation is ready.
After go-live: include your redirect_uri, environment (usually production), and the approximate time of a failed attempt (not end-user passwords, IdP client secrets, or refresh tokens).