JWKS Auth
JWKS Auth signs JWT assertions using managed RSA keys and publishes the corresponding public keys via an org-scoped JWKS endpoint. The signed JWT is used directly as a Bearer token in your API requests. Keys rotate automatically, and the JWKS endpoint serves both the current and next keys during a configurable grace period to ensure seamless rollover.
Need to exchange the JWT for an OAuth2 access token?
If your target API requires an OAuth2 access token rather than a direct JWT, select OAuth2 as the auth type and set the grant type to JWKS grant. See OAuth 2.0 - JWT Bearer Auth for the token exchange flow. This page covers direct JWT authentication only.
How It Works
- Generate a JWT using the configured claims and the org’s current private key.
- Sign the JWT with the org’s current private key.
- Use the signed JWT as
Authorization: Bearer <jwt>in the request header.
Step 1: Org-Scoped JWKS Endpoint
Verifiers can fetch public keys from the org-scoped JWKS endpoint. The org is inferred from the first label of the Host header (org alias or mapped subdomain).
- Endpoint:
GET /.well-known/jwks.json - Host:
https://{{tenant_name}}.moveworks.com(e.g.https://acme.moveworks.com) - Success:
200 OKwith{ "keys": [ JWK, ... ] } - Not found:
404when no JWKS config exists for the org - Bad request:
400for missing/invalid host or org alias - Rate limited:
429when rate limit is exceeded
Example response:
Step 2: How We Generate and Sign the JWT
- Key type: RSA 2048
- JWK fields:
kty,kid,n,e,x5c(self-signed certificate, 1-year TTL) - KID format: UUID, optionally prefixed when generated
- Claims:
iss,sub,aud,iat,expplus any additional claims - Headers: Optional custom headers (e.g.,
typ) can be set
Example (Python) of how the system constructs and signs the JWT using the org’s current private key:
Step 3: Use the Signed JWT in API Requests
Where $JWT_ASSERTION is the signed JWT from Step 2.
Key Management and Rotation
- Storage: A
JwksSecretstores a reference to the private key (in the secret store), the JWK JSON, and thekid. - Publication: The JWKS service serves the union of current and next JWKs for the org at
/.well-known/jwks.json. - Rotation inputs:
rotation_interval(days) androtation_grace_period(hours). - Grace period: both
currentandnextare served during the grace window; verifiers must accept tokens signed by eitherkiduntil the grace window ends. - System fields:
next_jwks(populated automatically),updated_at(last rotation),grade_period_ends_at(end of grace window).
Mermaid timeline illustrating rotation and grace:
Flow overview of key issuance and use:
Configuration Fields
To set this up:
-
Select
Jwks Authfrom theAuth Configdropdown. -
Click the
Generate JWKSbutton to generate the public and private key pair.
-
Fill in the required fields:
Notes:
- If the grace period is configured as 0, the system adds a small propagation buffer internally.
- The JWKS endpoint rate limits excessive requests and returns
429when over limit.
Implementation Notes
- JWKS endpoint:
/.well-known/jwks.json(serves keys for the org derived from the Host header subdomain). - Input config: org-scoped JWKS public keys are provided via a reloadable config; the endpoint parses and returns them in the standard JWKS format.
- Key format: RSA 2048 with
x5cincluding a self-signed certificate (1-year TTL). - Rotation: The platform maintains
currentandnextkeys in config and surfaces both during grace to support seamless rollover.
Verification Guidance
- Always select the verification key by the JWT
kidheader. - Cache JWKS responses per your policy, but refresh on signature failures or at reasonable intervals.
- During rotation, accept tokens signed with either the current or next
kiduntil the grace period ends. - If you see
404from the JWKS endpoint, verify that the org alias is correct and that JWKS is configured for the org.
Troubleshooting
- 400 invalid host or missing org alias: Ensure requests include a Host header like
<org-alias>.moveworks.com. - 404 no JWKS config: The org has no JWKS configured; configure
JwksSecretandJwks Authfirst. - 429 rate limit exceeded: Back off and retry with exponential backoff.
- Parsing errors in keys: Ensure JWK JSON follows spec (
kty,kid,n,e, optionalx5c).