OpenID Connect Core 1.0 & OAuth 2.1 Standard

SSO Integration Guide for Satellite Applications

For: Software Engineers & Technical Leads developing applications in the OneXCC Network (digital portals, internal tools, partner platforms).

Enforced PKCE S256Authorization Code FlowIssuer: https://iam.xcc.one/api/authMCP Host Ready (RFC 8707 & RFC 7591)
For AI Agents & CLI Automation

Quick Reference for Agents & Terminal

Machine-readable parameters and live curl test commands designed for automated coding agents and DevOps automation:

Discovery Endpoint (JSON)
/.well-known/openid-configuration
JWKS URI (Public Keys)
/jwks
Dynamic Registration (RFC 7591)
POST /oauth2/register
Token Revocation (RFC 7009)
POST /oauth2/revoke
Section 1Standard OIDC / OAuth 2.1 Architecture

XCC IAM serves as a fully compliant OpenID Connect Provider. All relying party applications authenticate using Authorization Code Flow with mandatory PKCE (S256).

Core Protocol Endpoints
EndpointMethodURL PathUsage
Issuer URLURIhttps://iam.xcc.one/api/authToken Issuer Identifier (Issuer URI)
OIDC Discovery (Machine/SDK)GEThttps://iam.xcc.one/.well-known/openid-configurationAutomatic server metadata discovery for machine SDKs (RFC 8414)
JWKS EndpointGEThttps://iam.xcc.one/jwksPublic keys for decoding & verifying JWT ID Tokens
AuthorizationGET / POSThttps://iam.xcc.one/oauth2/authorizeUser sign-in & consent delegation interface
Token EndpointPOSThttps://iam.xcc.one/oauth2/tokenExchange Authorization Code for Access & ID Tokens
UserInfo EndpointGET / POSThttps://iam.xcc.one/userinfoRetrieve authenticated user claims via Bearer Token
Dynamic Client Registration (RFC 7591)POSThttps://iam.xcc.one/oauth2/registerDynamic Client Registration for IDE Hosts / AI Agents via Initial Access Token (RFC 7591)
Token Revocation (RFC 7009)POSThttps://iam.xcc.one/oauth2/revokeInstantly revoke Access or Refresh Tokens per RFC 7009

Endpoint Specification (API Reference)

Detailed parameter breakdown, HTTP headers, request formats, and response schemas for each endpoint:

GEThttps://iam.xcc.one/oauth2/authorize

Initiate user authorization session and request an Authorization Code via the browser (Browser-based flow).

ParamTypeStatusDescription
client_idstringRequiredOAuth Client ID obtained during client registration in the Console or via DCR.
redirect_uristringRequiredCallback URL matching one of the whitelisted redirect URIs exactly.
response_typestringRequiredMust be set to fixed value: code
scopestringRequiredRequested scopes, must include openid (e.g. openid profile email mcp:access).
resourcestringOptionalProtected Resource Indicator per RFC 8707 (e.g. https://app.maerin.biz/api/mcp). Access Token JWT aud claim will be bound to this URI.
code_challengestringRequiredPKCE hash: BASE64URL(SHA256(code_verifier)).
code_challenge_methodstringRequiredMust be set to fixed value: S256
statestringRecommendedOpaque random string generated by client to mitigate CSRF attacks.
trackstringOptionalSpecifies 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.
Section 23-Step Integration Workflow

Connect Single Sign-On in three simple steps:

1Register Client on XCC IAM Console

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).
Important notice:Client Secret is shown only once upon creation. Store it immediately into your Secret Vault / .env.enc.
2Configure Environment Variables

Declare OIDC parameters in .env.local or your satellite app's production configuration:

.env.local
dotenv
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"
3Client Code Implementation

Integrate your authentication client library using the code samples below:

src/modules/auth/auth.ts (Consumer App)
typescript
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/api/auth/.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
        },
      ],
    }),
  ],
});
Section 3Received User Claims Payload

After successful authentication and consent approval, the client application receives an ID Token and UserInfo response containing standard claims:

User Claims (ID Token / UserInfo)
json
{
  "sub": "usr_xcc_123456789",
  "email": "[email protected]",
  "name": "Nguyễn Văn A",
  "image": "https://avatar.xcc.one/avatar.png",
  "email_verified": true
}
Section 4Mandatory Security Principles

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.

Section 5Persona Track Locking (Personal vs Enterprise Tab Management)

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):

Enterprise / B2B / Workspace Applications:

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.

Enterprise Track Authorization URL
text
https://iam.xcc.one/api/auth/oauth2/authorize?client_id=...&redirect_uri=...&response_type=code&scope=openid+profile&track=enterprise
Personal / B2C / Mobile Applications:

Append 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.

Personal Track Sign-in URL
text
https://iam.xcc.one/sign-in?track=personal&callbackURL=https://app.example.com/dashboard
Section 6AI Agent & MCP Host Integration (Model Context Protocol)

XCC IAM provides native OAuth 2.1 authorization with Dynamic Client Registration (RFC 7591) and Resource Indicators (RFC 8707) tailored for modern AI IDE hosts (Cursor, Windsurf, VS Code).

1. Dynamic Client Registration with Initial Access Token (RFC 7591)

IDE Hosts dynamically register client credentials via POST /oauth2/register using a pre-shared Initial Access Token (IAT) in the Authorization header:

RFC 7591 DCR Request (POST /oauth2/register)
bash
# 1. Đăng ký IDE Host Client động qua Initial Access Token:
curl -X POST https://iam.xcc.one/oauth2/register \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <MCP_INITIAL_ACCESS_TOKEN>" \
  -d '{
    "client_name": "Cursor IDE - Workstation",
    "redirect_uris": ["http://127.0.0.1:8080/callback"],
    "application_type": "native",
    "token_endpoint_auth_method": "none",
    "grant_types": ["authorization_code"],
    "response_types": ["code"]
  }'
Note: Native clients must use loopback redirect URIs (http://127.0.0.1:<port>/callback) or reverse-domain URIs (com.cursor.ide:/callback) per RFC 8252. No client_secret is issued for public clients.
2. Authorization Flow with Aud-Bound JWTs (RFC 8707 & PKCE S256)

The IDE initiates an authorization code request with scope mcp:access and the resource parameter targeting the MCP server:

Authorization URL with RFC 8707 Resource & PKCE S256
text
https://iam.xcc.one/oauth2/authorize?
  response_type=code&
  client_id=mcp_clnt_YOUR_CLIENT_ID&
  redirect_uri=http%3A%2F%2F127.0.0.1%3A8080%2Fcallback&
  scope=openid+profile+email+mcp%3Aaccess&
  resource=https%3A%2F%2Fapp.maerin.biz%2Fapi%2Fmcp&
  code_challenge=E9Melhoa2OwvFrEMTJguCHaoeK1t8URWbuGJSstw-cM&
  code_challenge_method=S256
3. Exchange Code for Resource-Bound JWT Access Token

The IDE exchanges the authorization code for an access token. The returned JWT contains an aud claim bound to the MCP server:

Token Exchange with Resource (POST /oauth2/token)
bash
# 2. Đổi Authorization Code lấy Resource-Bound JWT Access 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=mcp_clnt_YOUR_CLIENT_ID" \
  -d "redirect_uri=http://127.0.0.1:8080/callback" \
  -d "code=AUTHORIZATION_CODE_RECEIVED" \
  -d "code_verifier=YOUR_PKCE_CODE_VERIFIER" \
  -d "resource=https://app.maerin.biz/api/mcp"
4. Audit Trail & Instant Revocation (RFC 7009 & Admin Console)

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.

Ready to integrate with OneXCC Network?

Create your first OAuth Client in 30 seconds or inspect the live Discovery Endpoint.