Key Management
The bx-jwt named key registry — define keys once, reference them everywhere.
Defining Keys
settings = {
keys : {
// HMAC secret — supports ${env.VAR} placeholder substitution
"api-signing" : {
algorithm : "HS256",
secret : "${env.JWT_HMAC_SECRET}"
},
// RSA key pair (PEM file paths or inline PEM strings)
"api-rsa" : {
algorithm : "RS256",
privateKey : "/etc/keys/api-private.pem",
publicKey : "/etc/keys/api-public.pem"
},
// Public-only key for verifying third-party tokens
"partner-public" : {
algorithm : "RS256",
publicKey : "/etc/keys/partner-public.pem"
},
// JWK (JSON Web Key) defined inline
"oidc-verify" : {
algorithm : "RS256",
jwk : { kty: "RSA", n: "...", e: "AQAB" }
}
}
}Using Named Keys
Module-Wide Defaults
Runtime Key Management
Picking the Right Key Type
Use case
Recommended
Related
Last updated
Was this helpful?
