fetchClientSecrets callback.
How it fits together
Your frontend asks your backend for credentials
The SDK calls your
fetchClientSecrets function, which hits a route on your own server.Your backend calls the TORTUS launch endpoint
Authenticated with your client ID and secret, your server requests a launch token.
The launch endpoint
Authenticate with HTTP Basic Authentication using your TORTUS-provided credentials:| Part | Value |
|---|---|
| Username | Your client ID (e.g. cli_abc123xyz) |
| Password | Your client secret (e.g. sec_def456uvw) |
clientId:clientSecret and send it in the Authorization header.
Request body
All fields are optional. Send what’s relevant to your integration.Existing TORTUS user ID from a previous session. Provide this to resume a user’s session.
Your internal user ID, stored for reference.
User information to associate with this session.
Response
If the user doesn’t already exist, TORTUS creates one and returns it in the response. A newly created user only becomes valid once the launch token has been exchanged.The token to pass to the SDK. Valid for 5 minutes.
The TORTUS user ID for this session. Save it to resume the session later via
userId.Seconds until the token expires.
Wiring it into the SDK
Return the token fromfetchClientSecrets. The SDK calls this whenever it needs fresh credentials.