Auth0 Dynamic Client Registration Creates a New Application on Every Login
When a web application uses Auth0 Dynamic Client Registration (DCR) for third-party application creation, Auth0 creates a new application on every login attempt. This occurs because the application calls the DCR endpoint on each login.
To resolve this issue, store and reuse the client credentials after the initial registration. The observable symptom is that the Auth0 tenant quickly reaches the allowed number of applications limit because a new application is generated during every user authentication.
- Dynamic Client Registration (DCR)
- Auth0
The application calls the DCR endpoint (oidc/register) on each login. This endpoint creates a new application each time it receives a call.
How is the application logic updated to prevent duplicate application creation?
Update the application logic to store the credentials in a database, retrieve them during login attempts, and use them for the authentication flow.
- Store the
client_idandclient_secretfrom each third-party application in a database after the initial registration. - Retrieve the stored
client_idandclient_secretfrom the database when a login attempt occurs from the same third-party application. - Use the retrieved credentials for the authentication flow instead of calling the DCR endpoint again.