SSO Authentication
Exchange External SSO Assertion for Pinter Access Token
POST
/api/identity/sso/jwtOverview
Federated identity exchange and Just-In-Time (JIT) User Provisioning endpoint. Allows registered client applications (such as Sentra, Identik SSO, or corporate portals) to authenticate their own users and hand Pinter a short-lived assertion proving the user's identity. Pinter verifies the assertion against the registered application credentials and issues native access and refresh tokens.
Authentication & Headers
- Auth: Client Application Credentials (verified via pre-shared
client_secret) - Required Header:
API-Version: 1 - Application Header:
X-Application-ID: <Application-UUID>- Strictly required when sending encrypted
payload. - Highly recommended when sending
external_jwt(can also resolve app viaapp_id,aud, orissclaim).
- Strictly required when sending encrypted
Request Body & Envelope Formats (SSOTokenExchangeRequest)
You must supply exactly one of the following envelope fields:
payload(string, optional, recommended):- High-security AES-256-GCM ciphertext encrypted with a key derived from the application's
client_secret. - The
X-Application-IDis bound as Additional Authenticated Data (AAD) into the cipher, preventing cross-application replay attacks. - Enforces strict lifetime freshness (
ASSERTION_MAX_AGE_SECONDS).
- High-security AES-256-GCM ciphertext encrypted with a key derived from the application's
external_jwt(string, optional, legacy):- Standard HS256-signed JWT using the application's
client_secret.
- Standard HS256-signed JWT using the application's
Required Assertion Claims
The decrypted assertion or decoded JWT must contain:
username(string, required): The user's primary identity handle (e.g. employee NIK for Identik-federated systems, or app-scoped identifier). Baresubis rejected.name(string, required): Full display name of the user.email(string, required): Valid RFC-compliant corporate email address.exp(number, required): Expiration UNIX epoch timestamp (must be in the future and not exceed maximum lifetime).identity_source(string, optional):identik(corporate NIK) orapp(application-scoped). Must match the registered application trust mode.
Provisioning & Security Behavior
- JIT Provisioning: If the user does not exist, Pinter provisions a new account with
role_level = 4and assigns default quota. - Password Locking: Provisioned accounts receive a hashed password set to
SSO_EXTERNAL_USER, permanently disabling direct password login. - Profile Immutability: If the account already exists, existing name and email are never overwritten by incoming assertions.
- Audit Logging: Inserts or updates application access timestamps in
user_applications.last_access_at.
Parameter
Header
X-Application-IDstringRegistered Client Application UUID used during Single Sign-On (SSO) token exchange.
Body permintaan
application/json
payloadstring | nullexternal_jwtstring | null{
"payload": "string",
"external_jwt": "string"
} Respons
200 Assertion verified; Pinter bearer and refresh tokens issued
400 Missing X-Application-ID header, unknown application, or neither envelope provided
401 Decryption failed, invalid signature, expired assertion, or invalid email claim
403 User account is disabled or application identity_source mismatch
409 Username belongs to an existing non-SSO account
422 Validation Error
detailobject[]detail[].locstring | integer[]wajibdetail[].msgstringwajibdetail[].typestringwajibdetail[].inputobjectdetail[].ctxobject{
"detail": [
{
"loc": [
null
],
"msg": "string",
"type": "string",
"input": null,
"ctx": {}
}
]
}Contoh
curl -X POST "$PINTER_URL/api/identity/sso/jwt" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"payload":"string","external_jwt":"string"}'