Automated Testing with Identifier First Universal Login
This article explains that Auth0 Universal Login does not support script-based testing for the Identifier First flow and provides recommended methods for automating authentication tests.
- Auth0 Universal Login
- Identifier First Flow
- End-to-End (E2E) Testing
- Resource Owner Password Grant (ROPG)
The /u/login/password and /u/login/identifier endpoints are internal routes managed by the Auth0 Universal Login state engine and are not intended for direct programmatic access. The state engine flags requests as invalid if the identifier step is skipped, as this step prevents account enumeration and handles Home Realm Discovery (HRD).
To automate testing without manual intervention, use one of the following methods:
-
Browser-based E2E Testing: The only way to test the actual Universal Login pages is to use a browser automation tool, such as Cypress, Playwright, or Selenium, or another tool that best fits the organization's needs. These tools interact with the identifier screen by entering an email and selecting Continue.
For more information, refer to End-to-End Testing with Cypress and Auth0.
-
Resource Owner Password Grant (ROPG): To test application behavior after a successful login rather than the User Interface (UI) itself, use the ROPG flow.
-
Enable the Password grant type in the Application Settings within the Auth0 Dashboard.
-
Configure the script to send the username and password directly to the
/oauth/tokenendpoint.
NOTE: This method does not work if Multi-Factor Authentication (MFA) is required or if the user is redirected to a social or enterprise provider.
-
For additional information on quality assurance, review the Quality Assurance (B2C) documentation.