Revoke a signing key
Destroy a signing key version so nothing it signed verifies again, in the right order when a key is exposed.
API
You believe a signing key has leaked, or you’re retiring old keys after a rotation. Revoking a version destroys it in the key store: it leaves the published key set, and every token it signed stops verifying. Users holding such tokens sign in again, or their apps refresh.
Before you start: you need the MODIFY right on the realm’s keySettings. The key that is signing now can’t be
revoked, so if it’s the one you distrust, you’ll rotate first. It’s done through the API, with your session in
$CVYUH_SESSION: Call the API shows how to get it.
Revoke
Section titled “Revoke”-
Find the version. Call
GET https://foobar.cvyuh.com/api/v0/am/keys/v1. Each signing key version is an entry whosekeyisoauth2/signing, with itsversion,alg,stateandvalidFrom. The one signing now for an algorithm is thevalidentry with the latestvalidFromalready past. -
If it’s the key signing now, rotate that algorithm to a new key, with
validFromas soon as the publish lead allows, and wait until the new key has been signing for a minute (rotation.skewSecs). -
Revoke the version:
Terminal window curl -X DELETE https://foobar.cvyuh.com/api/v0/am/keys/v1/signing/<version> \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION"The realm answers
204.
Check it worked
Section titled “Check it worked”Call GET https://foobar.cvyuh.com/api/v0/am/keys/v1 again: a revoked version is destroyed, so it is no longer listed. Its kid is gone from
https://foobar.cvyuh.com/oauth2/jwks.
If it fails
Section titled “If it fails”400. The version is signing now, or started withinrotation.skewSecs(60 seconds by default). Rotate, wait until the new key has signed for longer than that, and revoke again.404. No such version, or it’s already revoked. List the keys and check the number.403. Your rights don’t includeMODIFYonkeySettings.
Each revocation is recorded on the realm’s audit trail as a DELETED record for the key version, under your name: see
Signing keys.
Undo it
Section titled “Undo it”A revocation can’t be undone: the key is destroyed. Tokens it signed can’t be made to verify again; their users sign in again.
Related
Section titled “Related”- Rotate signing keys: put a new key in place first.
- Signing keys: what the realm refuses, and why.