Key and certificate rotation
Replace an OAuth signing key or certificate without an outage.
An Okta service app can hold several public keys at once, and each client assertion names the key that signed it through its kid. This is what makes a clean changeover possible: register the new key alongside the old one, switch MIM over, confirm it works, and only then remove the old key.
This applies equally to a private JWK and to an X.509 certificate. A renewed certificate normally has a new key pair, which means a new thumbprint and a new kid, so renewing a certificate is the same process as replacing one.
You'll need a Super Administrator account to edit the app's keys, the same as when the OAuth scopes were granted.
Step 1: Create the replacement key
For a private JWK, create a new key pair and keep the public half. See OAuth with a private JWK.
For a certificate, create or enroll the replacement and export its public JWK. See OAuth with an X.509 certificate.
Give the new private JWK a kid that differs from the old one. A certificate does this for you, because the kid is its thumbprint.
Do not change the MIM configuration yet.
Step 2: Add the new public key to Okta
Open the service app in the Okta Admin Console.
On the General tab, in Client Credentials, select Edit.
In Public keys, select Add and paste the new public JWK.
Leave the old key in place.
Save.
The app now holds both keys and accepts assertions signed by either.
Step 3: Point MIM at the new key
On the Connectivity page, update the Private JWK file path or the Certificate thumbprint, then save the management agent.
Step 4: Test
Retrieve the schema.
Run a controlled import.
If the management agent exports, run a controlled export and a confirming import.
If anything fails, put the old path or thumbprint back on the Connectivity page. The old key is still registered in Okta, so the management agent starts working again immediately.
Step 5: Retire the old key
Remove the old public key from the service app.
Delete or archive the old private key according to your key retention policy. For a certificate, remove it from the store on the MIM server once you are sure nothing else uses it.
Last updated