Skip to main content
Docs

rotateSecret()

Rotates the client secret for a given OAuthApplication by its ID. When the client secret is rotated, ensure that you update it in your authorized OAuth clients.

function rotateSecret(oauthApplicationId: string): Promise<OAuthApplication>
  • Name
    oauthApplicationId
    Type
    string
    Description

    The ID of the OAuth application for which to rotate the client secret.

Note

Importing clerkClient varies based on your framework. Refer to the Backend SDK overview for usage details, including guidance on how to access the userId and other properties.

const oauthApplicationId = 'oauthapp_123'

const response = await clerkClient.oauthApplications.rotateSecret(oauthApplicationId)

Backend API (BAPI) endpoint

This method in the SDK is a wrapper around the BAPI endpoint POST/oauth_applications/{oauth_application_id}/rotate_secret. See the BAPI reference for more information.

Feedback

What did you think of this content?

Last updated on