Get Session JWT Public Key

Get session JWT public key endpoint

Endpoint: /jwt/publicKey Method: GET

// No request body required

Example Usage

// Fetch the public key
const response = await axios.get(apiEndpoint + '/jwt/publicKey');
const publicKey = response.data.publicKey;

// Verify a JWT locally
const decodedToken = jwt.verify(token, Buffer.from(publicKey, 'base64').toString('utf-8'), { algorithms: ['ES256'] });

Cache the public key and reuse it for multiple verifications. Only fetch a new key if verification fails.

Last updated