How it works
- Your client builds the HTTP request it wants to send, then submits
ACTIVITY_TYPE_MINT_JWTwith a digest of that request. - Turnkey evaluates your policies. If they need more approvals, the activity waits for them.
- Turnkey signs the JWT with ES256 and returns it.
- Your client sends the request with the JWT in the header. Your service checks the signature and that the token matches the request.
Who can mint
Your policies decide who can mint and who must approve. As with any activity, the root quorum can mint without a policy, and every other user needs one.The
jwt.profile.httpz.audience, jwt.profile.httpz.method, and jwt.profile.httpz.path policy fields are coming soon.Mint a token
headerNames and one headerDigest per name. You can’t bind authorization or hop-by-hop headers. See the Mint JWT API reference for every field.
Token claims
Theturnkey.io/http-authz/v1 profile produces these claims:
Verify a token
Your service checks each request:- Signature. Verify the ES256 signature with the key from
https://id.turnkey.com/t/<organization ID>/jwks.json. Use the organization ID fromiss. - Issuer and audience.
issis an organization you trust, andaudis your own origin. - Time.
expis in the future. - Request. The method, path, query, header digests, and body digest match the request you received.
- Subject.
subandorgare a user and organization allowed to make this request.
exp passes.
In Rust, turnkey_jwt_profiles runs all of these checks, with an optional axum middleware. The source is in tkhq/rust-sdk.