User API access
How to authenticate API requests on behalf of a logged-in user using a user access token.
User API access allows you to make authenticated API requests on behalf of a specific end user. This is used whenever the request involves personalized data or actions, such as viewing a user’s points balance or reporting an event.
To use user access, you’ll need to pass a valid user access token in addition to your API key.
When to use user access
Use user authentication when:
Reporting events
Fetching a user’s wallet or user-specific reward list
Redeeming a reward for a specific user
Accessing any user-specific data or actions
Authentication method
To authenticate on behalf of a user, include both headers in your request:
X-Api-Key: your-tenant-api-key
Authorization: Bearer user-access-token
Generating user access tokens
WLL does not issue user access tokens directly. You must generate tokens via your own identity provider (IdP), such as:
Firebase Auth
Auth0
Any OIDC-compliant service
WLL validates JWTs signed by your IdP, based on your configured authentication settings.
Token requirements
Your user tokens must meet the following criteria:
Format: JWT (per RFC 7519)
Algorithms:
RS256
(RSASSA-PKCS1-v1_5 with SHA-256) orHS256
(HMAC SHA-256)Required claims in the payload:
sub
(subject – unique user ID)iss
(issuer)iat
(issued at)exp
(expiration time)
If using RS256
, your token must also include a kid
(Key ID) header referencing a key from your JWKS endpoint.
Enabling user auth
To configure user authentication, login to the Loyalty Console and navigate to the Settings > Tenant screen. From here, you can specify:
Algorithm:
HS256
orRS256
Issuer: The expected value of the
iss
claimShared Key: The symmetric key for signing/validating tokens (if using HS256)
JWKS URL: The URL for your JWKS (if using RS256)
Once configured, WLL will begin validating user access tokens from your system.

Authorization behaviour
WLL uses your token for authentication only.
Authorization is handled internally based on the authenticated user’s account.
Claims in the JWT (e.g. roles, scopes) are not used for permissions.
Last updated
Was this helpful?