Credentials and Tokens at a Glance
Client Credentials
Client credentials identify your app on the JTL platform. Every registered app receives a pair: a Client ID (public) and a Client Secret (private). Together, they’re used to request access tokens from JTL’s identity provider.Client ID
Your app’s public identifier. It’s safe to include in logs and non-sensitive contexts. The Partner Portal displays it on your app’s detail page, and you can view it at any time.Client Secret
Your app’s private key, used alongside the Client ID to generate access token for your app. The Partner Portal displays it only once, immediately after registration.Regenerating a Lost Secret
The Partner Portal does not currently support in-place secret rotation. To regenerate, register a new app with the same manifest:- Log in to the Partner Portal
- Click the + Create button. You’ll see a registration wizard
- Fill in the details or use the JSON Code Editor to paste the contents of your
app.jsonfile - Click the app and copy the new Client Secret
- Update the secret in your app’s environment variables and redeploy.
Storage Best Practices
Access Token (JWT)
The access token is what your backend uses to authenticate API requests to JTL. You obtain it by sending your client credentials to JTL’s token endpoint via the client credentials grant.Token Response
When you request an access token, JTL returns:Using the Access Token
Include it in theAuthorization header of every API request:
Token Lifecycle
Access tokens expire in approximately 24 hours (expires_in: 86399). Handle this as follows:
- Cache the token: Don’t request a new one for every API call
- Track expiry: Store the
expires_invalue and request a new token before it expires (for example, when less than 5 minutes remain) - Handle 401 responses: A
401 Unauthorizedresponse typically means the token has expired. Request a new one and retry the request once.
Session Token
Session tokens are issued by the App Shell and identify which merchant (tenant) and user is currently interacting with your app. They are only relevant for Cloud Apps that run inside the App Shell. Unlike access tokens (requested by your app), session tokens come from the host environment. The App Shell passes them to your app through AppBridge, a lightweight SDK that handles session tokens, method calls, and events. For implementation details on retrieving and verifying session tokens, see Cloud Apps: Authentication & Login.Decoded Structure
A session token is a JWT with three parts: header, payload, and signature.Header
Payload
Signature
The signature ensures the token has not been tampered with. Your backend verifies it using JTL’s public keys, fetched from the JWKS endpoint.Verification
Session tokens must be verified server-side using JTL’s public keys:- Your backend requests an access token (client credentials grant)
- Using that access token, it fetches JTL’s public keys from the JWKS endpoint (
https://api.jtl-cloud.com/account/.well-known/jwks.json) - It uses the public key to verify the session token’s signature
- If the signature is valid, the payload (tenantId, userId, etc.) can be trusted
Never trust a session token without verifying it server-side. A token
received from the client (frontend) could be tampered with. Always verify
the signature against the JWKS public key before acting on the payload.
API Key (OnPremise)
API keys are permanent credentials used only in the OnPremise deployment model. They are generated through a two-step registration process in the JTL-Wawi desktop application.Key Characteristics
For the full OnPremise registration flow, see OAuth 2.0 Flow (OnPremise
tab).
Token Comparison
Inspecting Tokens for Debugging
During development, you may need to read a token’s contents to confirm what’s inside. For the verification flow that backends should use in production, see Cloud Apps: Authentication & Login.What’s Next?
OAuth 2.0 Flow
How to obtain access tokens, API keys, and SCX auth tokens.
Cloud Apps: Authentication
Implementation guide for session tokens, AppBridge, and the setup
handshake in Cloud Apps.
Error Handling
How to handle auth errors, expired tokens, and 401 responses.