Client credentials should be changed regularly. Employees leave, client credentials can be accidentally committed to version control, and wide-reaching security flaws can be discovered. While these situations pose security risks, in most cases you can address them without causing any downtime for your app by rotating your client credentials.
Client credentials are also known as **app credentials** or **API keys**.
> Caution:
> In the case of a serious security breach, you should immediately revoke your compromised client credentials before you generate new ones. This prevents a malicious attacker from accessing or modifying your users' data while you transition to new credentials. In some high-risk situations, application downtime can't be avoided while you address a security breach.
## Step 1: Create a new client secret
To communicate securely with Shopify’s API, you need to generate a new client secret. You can do this from your app's page in the Partner Dashboard.
1. Log in to your [Partner Dashboard](https://partners.shopify.com/organizations).
1. Click **Apps**.
1. Click the name of the app that you want to rotate client credentials for.
1. Click **API Access**.
1. In the **Client secret** section, click **Rotate**.
1. On the **Generate new client secret?** screen, click **Generate**.
The new client secret displays with a **New** label.
## Step 2: Configure webhooks
[Webhooks](/docs/apps/build/webhooks) are signed with your app's client secret to prevent forgeries. If your app uses webhooks, then configure it to accept both webhooks signed with the new client secret and webhooks signed with the old client secret until after you revoke the old secret.
> Caution:
> Shopify will sign webhooks with your app's oldest unrevoked client secret. We know it can be convenient to use the same client secret configuration for both OAuth and webhook validation, but this makes it easy to incorrectly validate webhooks using only the new client secret after following the [configure OAuth step](#step-3-configure-oauth).
## Step 3: Configure OAuth
Access tokens requested from Shopify’s API using the new client secret will be secure. Configure your app to use only the new client secret when [acquiring an access token](/docs/apps/build/authentication-authorization#authorization).
## Step 4: Generate a new refresh token
Many of the access tokens that your app stores will be associated with the old client secret. New access tokens must be requested from the Shopify API to work with the new client secret. You'll need a refresh token to generate these new access tokens.
You can generate a refresh token from your app’s page in the Partner Dashboard. Refresh tokens automatically expire after one hour.