Auth0 HTTP 500 Error Occurs When Rotating Client Secret for Legacy or Global Clients

Overview

When attempting to rotate the client secret of an application via the Auth0 Dashboard or Management API, the operation fails and Auth0 returns an HTTP 500 error. This error occurs for legacy or global clients because the JSON Web Token (JWT) configuration lacks initialization. Initialize the default configuration using a PATCH request to resolve the error.

 

HTTP 500 Internal Server Error

 

Applies To

  • Auth0
  • Tenant Global Clients (All Applications)
  • Legacy applications created before 2016
  • Secret rotation via Auth0 Dashboard or Management API

Cause

For certain legacy applications, the underlying JWT configuration is not initialized. When the secret rotation endpoint runs, Auth0 attempts to update a setting inside that configuration. Because the configuration is not initialized, the operation fails, and the API returns an HTTP 500 error.

Solution

What steps verify the uninitialized state?

Query the client details via the Management API to check whether the application lacks the initialized state.

  1. Send a GET request to the Management API.
    curl --request GET \
         --url 'https://<DOMAIN_NAME>/api/v2/clients/<CLIENT_ID>?fields=jwt_configuration' \
         --header 'authorization: Bearer <NAME_MGMT_API_ACCESS_TOKEN>'
  2. Review the response body. The response body omits jwt_configuration or returns without the standard configuration fields when the application lacks initialization. The response contains a complete jwt_configuration object when the application is healthy.

Initialize the JWT configuration and rotate the client secret.

Send a PATCH request to the Management API to initialize the default configuration, confirm the initialization, and rotate the client secret.

  1. Send a PATCH request to the Management API for the affected client ID with "jwt_configuration": null to populate the default JWT configuration.
    curl --request PATCH \
         --url 'https://<DOMAIN_NAME>/api/v2/clients/<CLIENT_ID>' \
         --header 'authorization: Bearer <NAME_MGMT_API_ACCESS_TOKEN>' \
         --header 'content-type: application/json' \
         --data '{
           "jwt_configuration": null
         }'
    NOTE: Pass "jwt_configuration": null explicitly. Do not pass an empty object ({ "jwt_configuration": {} }). Passing an empty object leaves secret_encoded unset, whereas passing null populates all default fields properly.
  2. Send a GET request to the Management API to confirm Auth0 populates jwt_configuration.
    curl --request GET \
         --url 'https://<DOMAIN_NAME>/api/v2/clients/<CLIENT_ID>?fields=jwt_configuration' \
         --header 'authorization: Bearer <NAME_MGMT_API_ACCESS_TOKEN>'
  3. Rotate the secret via the Auth0 Dashboard or by calling the rotation endpoint directly.
    curl --request POST \
         --url 'https://<DOMAIN_NAME>/api/v2/clients/<CLIENT_ID>/rotate-secret' \
         --header 'authorization: Bearer <NAME_MGMT_API_ACCESS_TOKEN>'

How does the patch client option update the client secret?

As an alternative to the rotation endpoint, manually set a new client secret by sending a PATCH request to the Management API containing the new client secret in the data payload.

curl --request PATCH \
     --url 'https://<DOMAIN_NAME>/api/v2/clients/<CLIENT_ID>' \
     --header 'authorization: Bearer <NAME_MGMT_API_ACCESS_TOKEN>' \
     --header 'content-type: application/json' \
     --data '{
       "client_secret": "<NEW_CLIENT_SECRET>"
     }'

Recommended content

No recommended content found...