SSO Integration Guide for Satellite Applications
For: Software Engineers & Technical Leads developing applications in the OneXCC Network (digital portals, internal tools, partner platforms).
Quick Reference for Agents & Terminal
Machine-readable parameters and live curl test commands designed for automated coding agents and DevOps automation:
XCC IAM serves as a fully compliant OpenID Connect Provider. All relying party applications authenticate using Authorization Code Flow with mandatory PKCE (S256).
| Endpoint | Method | URL Path | Usage |
|---|---|---|---|
| Issuer URL | URI | https://iam.xcc.one/api/auth | Token Issuer Identifier (Issuer URI) |
| OIDC Discovery (Machine/SDK) | GET | https://iam.xcc.one/.well-known/openid-configuration | Automatic server metadata discovery for machine SDKs (RFC 8414) |
| JWKS Endpoint | GET | https://iam.xcc.one/jwks | Public keys for decoding & verifying JWT ID Tokens |
| Authorization | GET / POST | https://iam.xcc.one/oauth2/authorize | User sign-in & consent delegation interface |
| Token Endpoint | POST | https://iam.xcc.one/oauth2/token | Exchange Authorization Code for Access & ID Tokens |
| OAuth Server Metadata (RFC 8414) | GET | https://iam.xcc.one/.well-known/oauth-authorization-server | OAuth 2.1 Authorization Server Metadata per RFC 8414 |
| Protected Resource (RFC 9728) | GET | https://iam.xcc.one/.well-known/oauth-protected-resource/api/mcp | OAuth 2.0 Protected Resource Metadata (RFC 9728) for MCP Server |
| UserInfo Endpoint | GET / POST | https://iam.xcc.one/oauth2/userinfo | Retrieve authenticated user claims via Bearer Token (canonical discovery endpoint: /oauth2/userinfo; alias: /userinfo) |
| Dynamic Client Registration (RFC 7591) | POST | https://iam.xcc.one/oauth2/register | Dynamic Client Registration (RFC 7591) is disabled (returns HTTP 403 access_denied and omitted from discovery); provision OAuth clients manually in /admin/projects |
| Token Revocation (RFC 7009) | POST | https://iam.xcc.one/oauth2/revoke | Instantly revoke Access or Refresh Tokens per RFC 7009 |
| Token Introspection (RFC 7662) | POST | https://iam.xcc.one/oauth2/introspect | Token Introspection endpoint (RFC 7662) |
| OIDC End-Session (Logout) | GET / POST | https://iam.xcc.one/oauth2/end-session | OIDC RP-Initiated End-Session (Logout) endpoint |
Endpoint Specification (API Reference)
Detailed parameter breakdown, HTTP headers, request formats, and response schemas for each endpoint:
Initiate user authorization session and request an Authorization Code via the browser (Browser-based flow).
| Param | Type | Status | Description |
|---|---|---|---|
| client_id | string | Required | OAuth Client ID obtained when an administrator creates the application in the Admin Console (/admin/projects). |
| redirect_uri | string | Required | Callback URL matching one of the whitelisted redirect URIs exactly. |
| response_type | string | Required | Must be set to fixed value: code |
| scope | string | Required | Requested scopes, must include openid (e.g. openid profile email mcp:access). |
| resource | string | Optional | Protected Resource Indicator per RFC 8707 (e.g. https://mcp.example.com/api). Access Token JWT aud claim will be bound to this URI. |
| code_challenge | string | Required | PKCE hash: BASE64URL(SHA256(code_verifier)). |
| code_challenge_method | string | Required | Must be set to fixed value: S256 |
| state | string | Recommended | Opaque random string generated by client to mitigate CSRF attacks. |
| track | string | Optional | Specifies account track: personal or enterprise (supports aliases account_type, user_type). If passed, XCC IAM locks the UI to that track and hides the 2-tab switcher; if omitted, both tabs are displayed for user selection. |
Connect Single Sign-On in three simple steps:
Administrators navigate to OAuth Clients Console, click Create Client and provide:
- Name: Application name shown on consent screen (e.g. OneXCC Portal Production).
- Redirect URIs: Whitelisted callback URLs (e.g. https://app.example.com/api/auth/callback/xcc-iam, http://localhost:3101/api/auth/callback/xcc-iam for dev).
Declare OIDC parameters in .env.local or your satellite app's production configuration:
OIDC_ISSUER=https://iam.xcc.one/api/auth
OIDC_CLIENT_ID=your_assigned_client_id
OIDC_CLIENT_SECRET=your_assigned_client_secret
OIDC_REDIRECT_URI=https://app.example.com/api/auth/callback/xcc-iam
OIDC_SCOPES="openid profile email"
# Dedicated for AI IDEs & MCP Hosts (Public Native Clients - No Secret Needed):
# Tạo OAuth Client tại Admin Console (/admin/projects) để nhận client_id thực tế
# Cursor IDE redirect_uri: cursor://anysphere.cursor-retrieval/auth
# Antigravity redirect_uri: antigravity://auth
# Scopes: "openid profile email offline_access mcp:access"
# Target Resource (Ví dụ): "https://mcp.example.com/api"Integrate your authentication client library using the code samples below:
import { betterAuth } from "better-auth";
import { genericOAuth } from "better-auth/plugins";
export const auth = betterAuth({
plugins: [
genericOAuth({
config: [
{
providerId: "xcc-iam",
clientId: process.env.OIDC_CLIENT_ID!,
clientSecret: process.env.OIDC_CLIENT_SECRET!,
discoveryUrl: "https://iam.xcc.one/.well-known/openid-configuration",
scopes: ["openid", "profile", "email"],
pkce: true, // Bắt buộc bật PKCE S256 theo tiêu chuẩn XCC IAM
},
],
}),
],
});After successful authentication and consent approval, the client application receives an ID Token and UserInfo response containing standard claims:
{
"sub": "usr_xcc_123456789",
"email": "[email protected]",
"name": "Nguyễn Văn A",
"image": "https://avatar.xcc.one/avatar.png",
"email_verified": true
}Mandatory PKCE (RFC 7636 S256)
All client applications (including SPAs, Mobile Apps, and Server-rendered apps) must enforce PKCE S256 to eliminate Authorization Code interception attacks.
Exact Redirect URI Matching
All callback URLs must be pre-registered character-for-character. XCC IAM immediately rejects authorization if redirect_uri differs by port or scheme.
Never Expose Client Secret to Frontend
Client Secrets must only be stored and used within server-side runtimes. Never bundle secrets into client JavaScript or public code repositories.
When redirecting users to XCC IAM, your relying party application can proactively control the active account track via request parameters (track, account_type, user_type):
Append track=enterprise (or account_type=enterprise) to the authorization URL. XCC IAM completely hides the 2-tab switcher and locks the UI into Enterprise mode with company email fields.
https://iam.xcc.one/oauth2/authorize?client_id=...&redirect_uri=...&response_type=code&scope=openid+profile&track=enterpriseAppend track=personal (or account_type=personal). XCC IAM hides the tab switcher and locks the UI into Personal ID mode. If no account type is specified, XCC IAM renders both tabs for the user to choose.
https://iam.xcc.one/sign-in?track=personal&callbackURL=https://app.example.com/dashboardXCC IAM provides native OAuth 2.1 authorization with RFC 8252 Custom URL Schemes, Resource Indicators (RFC 8707), and PKCE S256 tailored for AI IDE hosts (Cursor, Google Antigravity, Trae, Claude Desktop, VS Code) connecting to remote MCP servers.
Because Dynamic Client Registration (DCR) is disabled in production, each IDE workstation or MCP host must use a pre-seeded OAuth Client or one created manually in the Admin Console (/admin/projects). Desktop/IDE tools run as Native Public Clients (token_endpoint_auth_method: "none", PKCE S256 enforced, no client_secret required or permitted):
- 1. Open Admin Console (/admin/projects) -> Select your Project -> Click 'Create OAuth Client'.
- 2. Provide an Application Name (e.g. 'Cursor IDE - Dev Machine', 'Google Antigravity MCP', 'Trae IDE').
- 3. Select Application Type: Native / Public Client (the system enforces no client_secret and mandates PKCE S256).
- 4. Enter the Redirect URIs matching your IDE (refer to the scheme table below).
- 5. Grant Scopes: 'openid profile email mcp:access offline_access' and associate the target MCP Resource Server (e.g. https://mcp.example.com/api).
- 6. Save and copy the newly generated client_id (e.g. clnt_...) to configure your IDE or MCP agent.
Custom Scheme & LoopbackCustom Scheme & HTTPS CallbackCustom Scheme & LoopbackCustom Scheme & LoopbackCustom Scheme & LoopbackRequesting offline_access is mandatory for persistent IDE sessions. Access tokens expire after 1 hour; offline_access issues a cryptographically verified refresh_token so the IDE can silently renew tokens in the background via grant_type=refresh_token without interrupting the developer.
XCC IAM enforces an Admin-Gated Client Registry: RFC 7591 Dynamic Client Registration is disabled (allowDynamicClientRegistration: false). Both POST /oauth2/register and POST /api/auth/oauth2/register return HTTP 403 (error: 'access_denied'), and discovery metadata (/.well-known/openid-configuration and /.well-known/oauth-authorization-server) omits registration_endpoint.
# RFC 7591 Dynamic Client Registration is DISABLED on XCC IAM.
# Discovery omits registration_endpoint and POST /oauth2/register always returns 403 access_denied:
curl -i -X POST https://iam.xcc.one/oauth2/register \
-H "Content-Type: application/json" \
-d '{"client_name":"Test","redirect_uris":["http://localhost:8787/callback"],"token_endpoint_auth_method":"none"}'
# HTTP/1.1 403 Forbidden -> {"error":"access_denied","error_description":"Dynamic client registration is disabled..."}
# Provision OAuth 2.1 / MCP clients manually at https://iam.xcc.one/admin/projectsThe IDE initiates an authorization code request with scope mcp:access, offline_access, and the resource parameter targeting the MCP server:
https://iam.xcc.one/oauth2/authorize?
response_type=code&
client_id=YOUR_CLIENT_ID&
redirect_uri=cursor%3A%2F%2Fanysphere.cursor-retrieval%2Fauth&
scope=openid+profile+email+offline_access+mcp%3Aaccess&
resource=https%3A%2F%2Fmcp.example.com%2Fapi&
code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&
code_challenge_method=S256The IDE exchanges the authorization code for an aud-bound access token and refresh token, then renews the token silently via grant_type=refresh_token:
# 1. Đổi Authorization Code lấy Resource-Bound Access Token & Refresh Token:
curl -X POST https://iam.xcc.one/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code" \
-d "client_id=YOUR_CLIENT_ID" \
-d "redirect_uri=cursor://anysphere.cursor-retrieval/auth" \
-d "code=AUTHORIZATION_CODE_RECEIVED" \
-d "code_verifier=YOUR_PKCE_CODE_VERIFIER" \
-d "resource=https://mcp.example.com/api"# 2. Tự động làm mới Access Token ngầm (Silent Token Renewal via offline_access):
curl -X POST https://iam.xcc.one/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token" \
-d "client_id=YOUR_CLIENT_ID" \
-d "refresh_token=YOUR_REFRESH_TOKEN" \
-d "resource=https://mcp.example.com/api"All mcp:access delegations are logged to the audit system (oauth_consent.grant). Administrators can revoke access from the Admin Console, and clients can revoke tokens via POST /oauth2/revoke.