Authentication Flow
- Your SDK signs a JWT with the user identity and Client credentials.
- The Platform verifies the signature using the registered public key or shared secret.
- Your SDK exchanges the JWT for a Bearer Token used in all subsequent API calls.
JWT Flow
JWT Structure
A JWT has three dot-separated parts:header.payload.signature
Header
| Algorithm | Type | Key used for signing | Key used for verification |
|---|---|---|---|
| HS256 / HS512 | HMAC | Secret Key (shared) | Secret Key (shared) |
| RS256 / RS512 | RSA | Private Key (yours) | Public Key (uploaded to Platform) |
Payload
JWT Parameters
| Parameter | Type | Description |
|---|---|---|
alg | string | Signing algorithm: RS256, RS512, HS256, or HS512 |
typ | string | Token type — always JWT |
iat | integer | Token issue time in seconds |
exp | integer | Token expiry time in seconds |
jti or kore_jti (optional) | string | Unique JWT ID to prevent replay attacks. Use kore_jti to bypass pre-populated jti values. |
aud | string | Audience — always https://idproxy.kore.com/authorize |
iss or kore_iss | string | Client ID generated when the app was registered. Use kore_iss to bypass pre-populated iss values. |
sub or kore_sub | string | User identity (email or phone for known users; a unique random ID for anonymous users). Use kore_sub to bypass pre-populated sub values. |
isAnonymous | boolean | Set true for anonymous users. Anonymous users are not persisted on the Platform. Default: false. |
identityToMerge | string | Anonymous identity to merge into the known user. See Passing Mapped Identities. |
JTI Validations
Whenjti is included, the Platform enforces:
-
Expiry ≤ 1 hour — If violated:
-
No replay — If the same
jtiis reused:
Hosting the JWT Generation Service
The Client Secret or RSA Private Key must never be exposed client-side. Host JWT generation as a REST web service:- For the Web SDK: the service is called from the user’s browser.
- For mobile SDKs: the service is called from the user’s device.
| Language | Library |
|---|---|
| Node.js | node-jsonwebtoken |
| Java | java-jwt |
| .NET | jwt-dotnet |
JSON Web Encryption (JWE)
Use JWE to send sensitive data alongside the user identity in the JWT. Include the data insecureCustomData or privateClaims — it becomes available in the dialog context at context.session.UserContext.privateClaims.<field>.
JWE Token Structure
A JWE token has five parts:Header.EncryptedKey.IV.CipherText.AuthTag
JWE Header Parameters
| Parameter | Description |
|---|---|
alg | Key wrapping algorithm: RSA-OAEP or RSA1_5 |
enc | Content encryption algorithm: A128CBC-HS256, A128GCM, or A256GCM |
kid | Key ID of the Platform’s public key (shown when JWE is enabled) |
typ | Always JWT |
Generate a JWE Token
Steps:- Choose a JWE library for your language (Python:
PyJWT, Java:javax.crypto, Node.js:node-jose). - Prepare your payload — include sensitive fields under
privateClaimsorsecureCustomData. - Choose encryption algorithms.
- Use the Platform’s public key for asymmetric encryption.
Find the JWE Public Key
Enable the JWE option when creating an SDK app. The public key is displayed in JWK format.