> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Rotate Client Secrets

> Learn how to rotate an application's client secret using the Auth Dashboard or the Management API.

You can change an application's client secret (Client Secret: Secret used by a client (application) to authenticate with the Authorization Server; it should be known to only the client and the Authorization Server and must be sufficiently random to not be guessable.) using the Auth0 Dashboard (Client Secret: Secret used by a client (application) to authenticate with the Authorization Server; it should be known to only the client and the Authorization Server and must be sufficiently random to not be guessable.) or the Auth0 Management API (Auth0 Dashboard: Auth0's main product to configure your services.). When you rotate a client secret, you must update any authorized applications with the new value.

Client secrets should not be stored in public client applications. To learn more, read [Confidential and Public Applications.](/docs/docs/get-started/applications/confidential-and-public-applications)

> [!WARNING]
>
> New secrets may be delayed up to thirty seconds while rotating. During this propagation window, either the old or the new secret may be accepted, so your application should be configured to try both. To avoid downtime, deploy the new secret to your application *before* it becomes active. The recommended approach is to set a custom client secret in advance (see [Set a custom client secret](#set-a-custom-client-secret)): store the future secret in your application's code/system configuration as a fallback so it's already deployed when the rotation takes effect. Your app can then use whichever secret succeeds—if a request fails with the old secret, it falls back to the new one.
>
> Secrets can be stored in a list (or similar structure) until they're no longer needed. Once you're sure that an old secret is obsolete, you can remove its value from your app's code.

## Use the Dashboard

1. In the Auth0 Dashboard, go to [Applications > Applications](https://manage.auth0.com/#/applications), and then select the name of the application to view.

   ![Dashboard Applications List](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/1ecNwGgFQZxdP57p0tp3jT/cd608fcfae22e195b604e2707e5a848d/App_List_-_EN.png)
2. Scroll to the bottom of the **Settings** page, locate the **Danger Zone**, select **Rotate**, and confirm.
3. Scroll to the top of the page, and switch to the **Credentials** tab.
4. View your new secret by locating **Client Secret**, and selecting the eye icon.

   ![Dashboard Applications Application Settings Tab Basic Information](https://mintlify.s3.us-west-1.amazonaws.com/docs-dev/images/cdy7uua7fh8z/2GPUw7BODYuYYH3658Upz3/92a49ec57e6b4d07be96093989baac03/2023-04-11_15-34-58.png)
5. Update authorized applications with the new value.

## Use the Management API

1. Call the Management API [Rotate a client secret](/docs/docs/api/management/v2/clients/post-rotate-secret) endpoint. Replace the `{yourClientId}` and `{yourMgmtApiAccessToken}` placeholder values with your client ID and Management API access token, respectively.

Using the Auth0 CLI? If you haven't already, [set up and authenticate your CLI session](/docs/docs/deploy-monitor/auth0-cli) before running this command.

| Value | Description |
| - | - |
| `{yourClientId}` | Τhe ID of the application to be updated. |
| `MGMT_API_ACCESS_TOKEN` | [Access Tokens for the Management API](/docs/docs/secure/tokens/access-tokens/management-api-access-tokens) with the scope `update:client_keys`. |

2. Update authorized applications with the new value.

### Set a custom client secret

You can use the Management API [Update a client](/docs/docs/api/management/v2/#!/Clients/patch_clients_by_id) endpoint to to set a client secret manually instead of requesting a rotation to an automatically generated secret. Your application is configured with the future secret as a fallback ahead of the actual rotation.

> [tab] Auth0 CLI
>
> ```bash theme={null}
> auth0 api patch "clients/{ClientID}" \
>   --data '{
>   "client_secret": "{CustomClientSecret}"
>   }'
> ```

> [tab] cURL
>
> ```bash lines theme={null}
>    curl --request PATCH \
>    --url https://{TenantDomain}/api/v2/clients/{ClientID} \
>    --header 'Authorization: Bearer {AccessToken}' \
>    --header 'Content-Type: application/json' \
>    --data '{
>       "client_secret": "{CustomClientSecret}"
>       }'
> ```

## Learn more

* [View Signing Certificates](/docs/docs/get-started/tenant-settings/signing-keys/view-signing-certificates)
* [Signing Algorithms](/docs/docs/get-started/applications/signing-algorithms)
* [Change Application Signing Algorithms](/docs/docs/get-started/applications/change-application-signing-algorithms)
