Rotate Signing Key
Use this API endpoint to create a new Signing Key.
OneLogin recommends that you rotate your signing keys every 90 days so that in the event of a security breach you can rotate keys with the confidence that all of your OpenId Connect applications are configured correctly to automatically switch over to the new keys.
Generally speaking if you are using a certified OpenId Connect client it will be able to handle both new keys and those that have been rotated into a draining state.
This API request will create a new Signing Key with an active state and force all existing keys to a draining state.
All tokens issued after a new Signing Key has been created will use that key for thier signature.
Existing keys that move to the draining state will remain in the keys list and can still be used to validate tokens.
To remove keys in the draining state see the Revoke Signing Key endpoint.
Resource URL
https://<subdomain>.onelogin.com/oidc/2/signing_keys
Header Parameters
Authorization required string | Set to Set The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: |
Request Body
There are no parameters to be sent with this request.
Sample Responses
- 200 OK
- 401 Unauthorized
Returns the newly created Signing Key.
{
"kid": "ZoKMCcDDtLHKYPyZnXSDKTMmknGltey7M09CQy3RCIE",
"status": "active",
"kty": "RSA",
"use": "sig",
"n": "vy-2haKstl8Q5WSzxYLCAEqGRYgC1RgNeKifGOusvb_N82sf9iD7CUfJKQnfKU7sm3aEXIRE0YQTlwxVRIxRDYpljyfHE91mn0UWSs8gs2XwqNg8S7lNNrWCF6rQoX8asc2DvsE7g8jD606xs-nSGHOsYrZyD_HS2IcTUOHmCRQ9LMPPiuVfE06zV8A77zWG_lf7Mg46rY_uE5nDgzk-NKHvrhwZPrKjUc2d_DEqTPatG4ELxT0v-ZJLv1ysda8v1aJ1StG8Q2z3tpQZQPKjSEGZDKTPH6OdEgJwcZrCSeyx86I9ZC31AeGegnGbgqIU9a9EA0PZdWiQswc0_en-Mw",
"e": "AQAB"
}
Typically, this error means that your access token value is invalid.
{
"message": "Unauthorized",
"statusCode": 401,
"name": "UnauthorizedError"
}
Postman Collection
- Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.
Sample Code
cURL
Replace sample values indicated by < >
with your actual values.
List Mappings
curl 'https://<subdomain>.onelogin.com/oidc/2/signing_keys' \
-X POST \
-H "Authorization: bearer <access_token>"
Have a Question?
Found a problem or a bug? Submit a support ticket.
Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.
Have a product idea or request? Share it with us in our Ideas Portal.