Documentation base URLs use placeholder https://{your-tenant}.sso.id. Log in to show your tenant or custom domain.
Log in for Your Tenant URL
Chapter 3A — Social & Custom OAuth 2.0 Federation

OAuth 2.0 Social & Custom Connections

Eliminate signup friction by letting users sign in with Google, GitHub, Microsoft, Apple, LinkedIn, Facebook, or any custom OAuth 2.0 provider in under two minutes via /connections.

Developer Story: Boosting SaaS Sign-Up Conversion by 42%

Adding Google & GitHub Login Without Writing Provider-Specific Code

CloudPulse's growth team noticed developers were dropping off at the registration form because they didn't want to invent another password. Instead of installing separate Passport.js strategies for Google, GitHub, and LinkedIn inside their application code, CloudPulse configured those three OAuth 2.0 providers in SSO.ID v2 ( /connections) and enabled them on their Application.

Zero Code Changes in Your App: Your application still speaks a single standard OIDC/OAuth 2.0 flow with https://{your-tenant}.sso.id/auth. SSO.ID brokers the upstream OAuth 2.0 handshake with Google or GitHub, normalizes the profile attributes, auto-provisions the user, and returns a clean, standard SSO.ID JWT to your app.

1. Pre-Configured OAuth 2.0 Provider Templates

When you click Create Connection in /connections and choose OAuth 2.0, SSO.ID loads verified defaults from GET /api/connections/defaults so Authorization URLs, Token URLs, UserInfo URLs, and default scopes are pre-filled automatically:

Flow Diagram Social OAuth 2.0 Brokering & Profile Normalization Flow
flowchart LR APP["Client App"] -->|"Standard OIDC Request"| SSO["SSO.ID Broker (Auth.SSO.Id)"] SSO -->|"OAuth 2.0 Handshake"| SOC{"Social IdP"} SOC -->|"Google"| G["Google Profile (sub, email, picture)"] SOC -->|"GitHub"| GH["GitHub Profile (id, login, avatar_url)"] SOC -->|"LinkedIn"| LI["LinkedIn Profile (id, localizedFirstName)"] G --> NORM["SSO.ID Normalization Engine"] GH --> NORM LI --> NORM NORM --> APPTOK["Unified Standard SSO.ID JWT & User Claims"]
SSO.ID abstracts disparate provider schemas (Google, GitHub, Apple), returning a unified RS256 token and user profile to your application.
Provider Pre-Configured Endpoints Default Scopes Callback URL to Register in Provider Console
Google accounts.google.com/o/oauth2/v2/auth
oauth2.googleapis.com/token
openid profile email https://{your-tenant}.sso.id/auth/oauth/callback (or your custom domain)
GitHub github.com/login/oauth/authorize
github.com/login/oauth/access_token
read:user user:email https://{your-tenant}.sso.id/auth/oauth/callback
Microsoft login.microsoftonline.com/common/oauth2/v2.0/authorize openid profile email User.Read https://{your-tenant}.sso.id/auth/oauth/callback
LinkedIn / Apple / Facebook Pre-configured OAuth 2.0 v2 endpoints openid profile email https://{your-tenant}.sso.id/auth/oauth/callback
Custom OAuth 2.0 Any RFC 6749 Authorization, Token & UserInfo URL Custom space-delimited scopes https://{your-tenant}.sso.id/auth/oauth/callback

2. Step-by-Step Setup in the v2 Admin Console

1

Select OAuth 2.0 & Provider Template

Navigate to /connections → Add Connection → select OAuth 2.0. Pick a template (e.g., Google or GitHub) or choose Custom. Paste the Client ID and Client Secret obtained from the external provider's developer console.

2

Run Live Pre-Save Test (POST /api/connections/test)

Click Test Connection at the bottom of the dialog. Authenticate with your Google/GitHub account in the popup window and verify that SSO.ID receives your email, name, and avatar cleanly.

3

Enable on Target Applications or Organizations

Enable the connection globally for specific Applications ( /applications → Settings → Connections tab) or scope it to a specific B2B customer Organization using assignToOrganizationOnly.

3. Attribute Mapping & Just-In-Time (JIT) Provisioning

In the Mappings tab of the OAuth 2.0 Connection dialog, configure how JSON fields returned by the provider's UserInfo endpoint map to SSO.ID user properties:

  • email ← email (or primary verified email from GitHub)
  • firstName ← given_name (or split from name)
  • lastName ← family_name
  • avatarUrl ← picture / avatar_url

4. Programmatic Creation & AI Agent Prompt

OAuth 2.0 Authorization, Token Exchange & Social Connection API Specifications

Below is the complete parameter-level specification for every endpoint in this module. Tenant context is automatically resolved from the signed Bearer JWT token claims or the tenant domain URL (no custom tenant header is required).

GET https://{your-tenant}.sso.id/auth/oauth/authorize
Browser Redirect

OAuth 2.0 / OIDC Authorization Endpoint. Initiates browser-based Authorization Code + PKCE (S256) flows, direct Social/Enterprise IdP routing via connectionId, or B2B workspace routing via organizationId and organizationUnitId.

Request Parameters
Parameter Type Required Description & Constraints
client_id Query string Required Public Client ID of the target SSO.ID Application.
response_type Query string Required Must be code for Authorization Code flow (or id_token / code id_token).
redirect_uri Query string (URL) Required Callback URI registered in the Application's replyURL allowlist.
scope Query string Required Space-delimited scopes (e.g., openid profile email roles offline_access).
state Query string Required Cryptographically random CSRF protection state token returned unchanged to redirect_uri.
code_challenge Query string (Base64URL) Required PKCE SHA-256 hash of code_verifier (BASE64URL(SHA256(code_verifier))).
code_challenge_method Query string Required PKCE transformation method; always use S256.
nonce Query string Optional Random string bound into the resulting id_token to prevent replay attacks.
connectionId Query string (UUID) Optional Optional Connection UUID (e.g., Google, GitHub, Okta). When provided, bypasses the hosted login chooser and redirects straight to that IdP.
organizationId Query string (UUID) Optional Optional Tier-3 Organization UUID to apply customer-specific branding, MFA policies, and allowed IdPs.
organizationUnitId Query string (UUID) Optional Optional Tier-4 Organization Unit UUID for department-level policy enforcement.
login_hint Query string Optional Pre-populates the user's email address and triggers automatic Home Realm Discovery (HRD).
prompt Query string Optional Controls interactive behavior: login (force re-auth), none (silent SSO check), or select_account (show Multi-Account Switcher).
Response Fields & Schema
Field Type Description
code Query (302 Redirect) One-time authorization code appended to redirect_uri (valid for 5 minutes).
state Query (302 Redirect) Exact state value supplied in the authorization request.
Sample Request
GET https://{your-tenant}.sso.id/auth/oauth/authorize?client_id=cp_crm_prod_99182&response_type=code&redirect_uri=https%3A%2F%2Fcrm.cloudpulse.io%2Fcallback&scope=openid%20profile%20email%20roles%20offline_access&state=st_88192a&code_challenge=E9Melhoa2OwvFrEMTgu3chv2K_t8URXrG2-7_2V3a2Y&code_challenge_method=S256&connectionId=con_google_oauth2_01
Expected Response 302 Found
HTTP/1.1 302 Found
Location: https://crm.cloudpulse.io/callback?code=authcode_9918273645abcdef&state=st_88192a
POST https://{your-tenant}.sso.id/auth/oauth/token
Client Credentials / PKCE

OAuth 2.0 Token Exchange Endpoint (also exposed at POST https://{your-tenant}.sso.id/api/oauth2/token for JSON payloads). Exchanges an authorization code, refresh token, client credentials, or password credentials for signed RS256 JWT tokens.

Request Parameters
Parameter Type Required Description & Constraints
grant_type Form / Body string Required Grant type: authorization_code, refresh_token, client_credentials, or password.
client_id Form / Body string Required Application Client ID.
client_secret Form / Body string Optional Application Client Secret (required for confidential apps, client_credentials, and password grants).
code Form / Body string Optional Authorization code received from /oauth/authorize (required when grant_type=authorization_code).
redirect_uri Form / Body string (URL) Optional Must match the redirect_uri used in /oauth/authorize.
code_verifier Form / Body string Optional Original 43-128 character PKCE plaintext verifier matching code_challenge.
refresh_token Form / Body string Optional Refresh token string (required when grant_type=refresh_token).
username Form / Body string Optional User email address (required when grant_type=password).
password Form / Body string Optional User plaintext password (required when grant_type=password).
scope Form / Body string Optional Requested space-delimited scopes.
Response Fields & Schema
Field Type Description
access_token string (JWT) Signed RS256 JWT access token containing sub, email, roles, tenant_id, and app_id claims.
id_token string (JWT) Signed OIDC ID Token containing user profile claims.
refresh_token string Rotating opaque refresh token (returned when offline_access scope is granted).
token_type string Always Bearer.
expires_in integer Access token lifetime in seconds (default: 3600).
Sample Request
curl -X POST "https://{your-tenant}.sso.id/auth/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "client_id=cp_crm_prod_99182" \
  -d "code=authcode_9918273645abcdef" \
  -d "redirect_uri=https://crm.cloudpulse.io/callback" \
  -d "code_verifier=dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk"
Expected Response 200 OK
{
  "access_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6InNzb2lkLTIwMjYta2V5LTAxIn0...",
  "id_token": "eyJhbGciOiJSUzI1NiIsImtpZCI6InNzb2lkLTIwMjYta2V5LTAxIn0...",
  "refresh_token": "rt_881920394857abcdef11223344",
  "token_type": "Bearer",
  "expires_in": 3600
}
GET https://{your-tenant}.sso.id/auth/oauth/userinfo
Bearer Access Token

OIDC Standard UserInfo Endpoint. Returns verified identity claims for the user represented by the Bearer access_token, normalized across direct directory logins and federated OAuth2/OIDC/SAML connections.

Request Parameters
Parameter Type Required Description & Constraints
Authorization Header string Required Bearer JWT access token (Bearer eyJhbG...). Tenant context is resolved automatically from the token claims or request domain URL.
Response Fields & Schema
Field Type Description
sub string (UUID) Unique immutable SSO.ID User ID.
email string Verified primary email address.
email_verified boolean Whether the email address has been verified.
name string Full display name.
given_name string First name.
family_name string Last name.
picture string (URL) Profile avatar URL.
roles array Application roles assigned to the user.
tenant_id string (UUID) Tenant Workspace UUID.
Sample Request
curl -X GET "https://{your-tenant}.sso.id/auth/oauth/userinfo" \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..."
Expected Response 200 OK
{
  "sub": "usr_9f8e7d6c-5b4a-3c2d-1e0f-9a8b7c6d5e4f",
  "email": "[email protected]",
  "email_verified": true,
  "name": "Liam Mercer",
  "given_name": "Liam",
  "family_name": "Mercer",
  "roles": ["Support Specialist"],
  "tenant_id": "8c60a951-7e5c-4f25-8306-b62c7519c97a"
}
GET https://{your-tenant}.sso.id/auth/oauth/logout
Public / Session

OIDC RP-Initiated Logout Endpoint. Terminates the user's SSO session cookie, revokes active tokens for the client application, and redirects the browser to post_logout_redirect_uri.

Request Parameters
Parameter Type Required Description & Constraints
client_id Query string Optional Application Client ID initiating logout.
post_logout_redirect_uri Query string (URL) Optional Registered post-logout destination URL (or redirect_uri).
id_token_hint Query string (JWT) Optional Previously issued ID Token identifying the session being terminated.
email Query string Optional Optional account email when signing out a specific identity from the Multi-Account Switcher.
Response Fields & Schema
Field Type Description
Location Header (302) Redirects browser to post_logout_redirect_uri.
Sample Request
GET https://{your-tenant}.sso.id/auth/oauth/logout?client_id=cp_crm_prod_99182&post_logout_redirect_uri=https%3A%2F%2Fcrm.cloudpulse.io%2Flogin
Expected Response 302 Found
HTTP/1.1 302 Found
Location: https://crm.cloudpulse.io/login
AI Agent Prompt Create & Wire an OAuth 2.0 Social Connection via API & Frontend Button
You are a full-stack identity developer. Add "Continue with Google" and "Continue with GitHub" buttons to my application using **SSO.ID v2**.

### How SSO.ID v2 Social Login Works
1. In the Admin Console (`/connections`), we created Google (`CONNECTION_ID_GOOGLE`) and GitHub (`CONNECTION_ID_GITHUB`) OAuth 2.0 connections and enabled them on our Application (`CLIENT_ID`).
2. To trigger social login directly from our custom frontend button (bypassing the hosted chooser) OR via the hosted login page:
   - Redirect the browser to `GET https://{your-tenant}.sso.id/auth/oauth/authorize` with standard OIDC PKCE params (`client_id`, `response_type=code`, `redirect_uri`, `scope=openid profile email`, `state`, `code_challenge`, `code_challenge_method=S256`) PLUS `connectionId=${CONNECTION_ID_GOOGLE}`.
3. Handle the callback on `redirect_uri` identically to standard OIDC by exchanging `code` at `POST https://{your-tenant}.sso.id/auth/oauth/token`.

Please generate the social login button components and PKCE redirect helper.