JSON Web Tokens (JWT)
Learn how to integrate JSON Web Tokens (JWT) with Zephr for secure identity management and user authentication.
In some instances, you may wish to use an Identity Management Provider that is separate to the Zephr Identity Module.
Integrating an external identity store with Zephr is simple, as Zephr has a number of integration points with other data sources. Our recommendation for doing this, however, is to use a JSON Web Token (JWT) for each user.
In this scenario, the identity provider signs a JWT and sets it as a cookie; requests to Zephr that have the appropriate bearer token will inherit products grants and user attributes based upon claims in the payload. This guide discusses the use of JWT tokens with Zephr and guides you through the setup process.
What is a JWT?
JSON Web Tokens are cryptographically verified payloads that can be passed with HTTP requests, much like a cookie. JWTs are used to pass information between server-side systems, via an end-user's client (a web browser) without allowing the information to be tampered with.
A JWT consists of three parts: a metadata header, a payload (JSON) and a signature. A JWT is created by signing then payload using a private key, the public key can then be shared with interested 3rd parties who can then verify the integrity of the payload.
How does JWT work with Zephr?
When using JWT with Zephr, it is important to know that your identity provider is able to provide a JWT when a user logs in. This is typically done as a browser cookie (using the Set-Cookie header) but can be handled in other ways too.
blaize_jwt={jwt token}In these implementations, login and registration requests will happen against your Identity Management system, independently to any Zephr function.
For all site requests running through Zephr, there will be a check for a valid JWT which, if present, will be used as the inputs to any decisions, including whether a user has a particular product grant.
Configuring the Zephr JWT Integration
JWT mappings can be used within Zephr to map products from another identity source, to the products set up within Zephr, in order to be used in Decisions.
To configure your JWT integration and enable product syncing, navigate to .
Depending on your integration, you can verify incoming JWT signatures using either of the following methods:
-
Static Secret or Public Key: Enter your shared secret (for symmetric HMAC algorithms) or public key (for asymmetric RSA/ECDSA algorithms) in the Secret Key or Public Key field, and save the details.
JWKS URL Endpoint:
Configure a JSON Web Key Set endpoint to dynamically verify signatures using keys published by your identity provider. For step-by-step instructions, see Configure JWKS-based JWT verification.-
After signature verification is established, you can optionally configure Enabling product syncing with JWT and Enabling user mapping with JWT.