New Ory Agent Security is now live! Claim your complimentary test drive. Get Started!

Skip to main content

Rotate OAuth 2.0 Client Secret

POST 

/admin/clients/:id/secrets/rotate

Rotates an OAuth 2.0 client's secrets. The old secret will remain valid for authentication, allowing for zero-downtime secret rotations. A new secret will be generated and returned in the response.

Up to five rotated secrets are retained. Use the deleteRotatedOAuth2ClientSecrets endpoint to remove old rotated secrets when they are no longer needed.

Supply client_secret in the request body to rotate to a specific value instead of a generated one. The request body is optional.

SDK ReferenceTypeScript
rotateOAuth2ClientSecret()
ParametersTypeRequiredDescription
rotateOAuth2ClientSecretBodyRotateOAuth2ClientSecretBodyrequired
idstringrequiredOAuth 2.0 Client ID
VariableType
dataOAuth2Client