LogoLogo
Useful links
  • Home
  • Product guides
  • APIs
  • SDKs
  • Overview
  • Authentication
  • ANDROID
    • Getting Started with the SDK
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • Setting up the SDK
          • Setting properties
          • Capture Stages
          • Messages Settings
          • Customization
          • Security Settings
          • Detection Steps
          • Upload Mode
          • Advanced Settings
            • Proxy configuration
            • Preview configuration
        • Start Document Detection
        • Source Code
        • Google security form
        • Reduce SDKs size
        • SDKs response
        • References
        • FAQ
      • Face Liveness
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • SDK Lifecycle
        • Building the SDK
        • Start Liveness Verification
        • Source Code
        • References
        • Advanced Features
        • FAQ
      • Face Authenticator
        • Release Notes
      • Smart Auth
        • Release Notes
        • Current Version
        • Requirements
        • Gradle Dependencies
        • Gradle Source Code
        • Permissions
        • SDK Lifecycle
        • Building the SDK
        • Start Smart Authentication
        • Source Code
        • References
        • FAQ
      • Face Liveness (deprecated)
        • Release Notes
  • iOS
    • Getting Started with the SDK
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Installing the SDK
        • Setting up the SDK
          • Setting properties
          • Messages Settings
          • Customization
          • Detection Steps
          • Upload Mode
          • Advanced Settings
            • Proxy configuration
            • Preview configuration
        • Start Document Detection
        • References
        • FAQ
      • Face Liveness
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • SDK Lifecycle
        • Building the SDK
        • Start Liveness Verification
        • Source Code
        • References
        • FAQ
      • Face Authenticator
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • Building the SDK
        • Start the SDK
        • References
        • FAQ
      • Smart Auth
        • Release Notes
        • Installation
        • Current Version
        • Requirements
        • SDK Lifecycle
        • Building the SDK
        • Start Smart Authentication
        • Source Code
        • References
        • FAQ
      • Face Liveness (deprecated)
        • Release Notes
  • REACT NATIVE
    • Standalone Modules
      • Document Detector
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Document Verification
        • Source Code
        • TypeScript References
        • Customizing Style
        • FAQ
      • Face Liveness
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Liveness Verification
        • Source Code
        • TypeScript References
        • FAQ
      • Face Authenticator
        • Release Notes
        • Current Version
        • Requirements
        • Installation
        • Hooks
        • Start Authentication Verification
        • Source Code
        • TypeScript References
        • FAQ
      • Smart Auth
        • Getting started
        • Release notes
        • Using Native Modules
          • Requirements
          • Gradle Source Code
          • Podfile Source Code
          • Native Module Android
          • Native Module iOS
          • Import Native Modules
          • Source Code
          • TypeScript References
          • FAQ
        • Using Expo Modules
          • Requirements
          • Create Local Expo Module
          • Gradle Source Code
          • Podspec Source Code
          • Native Module Android
          • Native Module iOS
          • Import Expo Modules
          • Source Code
          • TypeScript References
          • FAQ
  • WEB (JAVASCRIPT)
    • Standalone Modules
      • Document Detector
        • Getting started
        • SDK builder options
          • Analytics
          • Appearance
          • Messages
        • SDK methods
        • Event listeners
        • Customization
        • Release notes
      • Face Liveness
        • Customization
        • Release notes
      • Face Authenticator
        • Customization
        • Release notes
      • Smart Auth
        • SDK errors
        • Customization
        • Release notes
LogoLogo

Políticas

  • Política de depreciação de Recursos
  • Deprecation Policy for Resources

2025 © Caf. - All rights reserved

On this page

Authentication

This guide explains how to securely and efficiently authenticate Caf SDKs.

Integration overview

  1. Obtain access credentials (Mobile Key)

  2. Generate the Authentication Token (JWT signed with your client-secret)

  3. Exchange this token for a Mobile Token (Session Token)

  4. Use the Mobile Token when initializing the SDK

For clients using Caf SDKs who subsequently create transactions to perform additional validations, you will have an additional step: link the Mobile Token to a transaction, sending it as a referenceToken in the creation request to allow complete tracking of the user journey. Check out Transaction linking for more details.

1. Obtain access credentials (Mobile Key)

Mobile Keys are used to sign and authenticate requests.

How to obtain:

  1. Go to the Trust Platform

  2. Navigate to Settings → API configurations (Mobile Keys "tab")

  3. Copy an existing key or create a new one, specifying the products and key name.

2. Generate Authentication Token (JWT)

This JWT is generated on your server and signed with the Mobile Key's client-secret.

Payload fields:

Field
Required
Description

iss

Yes

Your client-id (provided by CAF)

exp

No

Token expiration (Unix timestamp)

Example payload:

{
  "iss": "your-client-id",
  "exp": 1728000000
}

This JWT must be signed with the Mobile Key's client-secret.

3. Exchange Authentication Token for Mobile Token

After generating the JWT, you must exchange it for the Mobile Token, which will be used to initialize the SDK. For each SDK session in your application, generate a Mobile Token using the previously created Authentication Token.

4. Use the Mobile Token in the SDK

The mobile-token (Session Token) is used during SDK initialization and ensures that each session is securely authenticated and traceable.

Below is how to integrate it on different platforms:

let builder = CafSdkProvider.Builder(
    mobileToken: "mobile-token",
    ...
)

Check out iOS SDK Integration for more details.

val builder = CafSdkProvider.Builder(
    mobileToken = "mobile-token",
    ...
).build()

Check out Android SDK Integration for more details.

const builder = await CafSdkProvider.initializeSdk(
  "mobile-token",
  ...
);

Check out Web SDK Integration for more details.

Transaction linking

To ensure the security and complete traceability of the user journey, each transaction created via the API must be linked to the original session generated by the SDK. This link is made by including the Mobile Token (session token) in your calls, creating a unified audit trail.

See Transaction linking for more details.

Best practices

✅ Do
❌ Avoid

Generate and sign tokens on the server

Generating tokens on the frontend

Exchange the JWT at the /session-tokens endpoint before initializing the SDK

Storing keys or secrets in the app

Use short expiration times for the JWT

Validate SDK responses on the backend using the client-secret

Last updated 1 day ago

Generate Mobile Token (Session Token)

get

Returns a JWT token enriched with a unique session identifier.

Authorizations
Responses
200
JWT generated with session details
application/json
401
Invalid or missing token
application/json
500
Internal server error
application/json
get
GET /bff/session-tokens HTTP/1.1
Host: web.us.prd.caf.io
Authorization: Bearer JWT
Accept: */*
{
  "requestId": "123e4567-e89b-12d3-a456-426614174000",
  "sessionToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
  • Integration overview
  • 1. Obtain access credentials (Mobile Key)
  • 2. Generate Authentication Token (JWT)
  • 3. Exchange Authentication Token for Mobile Token
  • GETGenerate Mobile Token (Session Token)
  • 4. Use the Mobile Token in the SDK
  • Transaction linking
  • Best practices