Before release, test signup authentication by checking each method and hook your flow uses against its documented behavior, starting with the email OTP path.
Key takeaways
Before release, check these documented boundaries in staging:
- OTP lifecycle: Auth0 documents that the issued OTP is valid for three minutes by default before it expires. If your configuration sets a different expiry, test against that configured value instead.
- OTP limit: According to Auth0, only three failed attempts to input the OTP are allowed. Test the system's behavior when a user enters an incorrect code four times, and record whether your implementation blocks further attempts after the third failure.
- Hook response time: For blocking functions, the Firebase documentation requires that your function must respond within 7 seconds. Measure the total execution time of your hook in staging. If the response exceeds seven seconds, the authentication request will not complete as expected.
Signup authentication testing: the provider-specific test order
Auth0 documents that you can configure a Passwordless connection to send a one-time password (OTP) to a user through email to complete authentication. This defines the baseline email path for your test sequence. Before releasing a new account flow, verify that the authentication methods and hooks your flow actually uses behave as their providers describe. Do not assume every signup flow requires every test in this plan; instead, match your specific configuration to the relevant documented behavior.
Start by identifying which authentication components are active in your staging environment. If your flow uses email-based passwordless login, the OTP lifecycle is your first testing priority. You must confirm that the system sends the code, accepts the correct code, and rejects invalid or expired codes according to the provider's rules. For flows using custom hooks or functions, you must verify response timing and error handling against the specific provider's requirements.
The test order follows the critical path of user authentication. First, test the creation and delivery of the initial credential. Second, test the validation logic that accepts or rejects that credential. Third, test any custom code that runs during the authentication process. Fourth, test the permissions and access controls governing that code. Finally, test protocol-level behaviors such as response caching and method handling. This sequence ensures you catch configuration errors at the point where they affect the user.
Steps one and two: test OTP creation, reuse, expiry and attempts
When a new user receives an OTP and enters it for the first time on your website, their user profile is created on the email connection before being authenticated by Auth0. This sequence defines the first check for your staging environment. After the first code entry, check the profile on Auth0's email connection.
Next, test a second code request made while the first code is unused. According to the documentation, only the last OTP (or link) issued will be accepted, so the system must reject the first code and accept only the most recent one. This ensures that your frontend error messaging aligns with the backend logic, informing users that their previous code is no longer valid.
Following the replacement test, verify the rejection of used codes. Once used, the latest one is also invalidated. This means that a code cannot be reused for a second login attempt. In your test sequence, enter a valid code to complete authentication, then attempt to use the same code again in a new session or for a different action. The system must deny access. This check confirms that your session management correctly treats the OTP as a single-use credential. If your application allows multiple concurrent sessions or re-authentication flows, ensure that the invalidation logic applies consistently across all entry points.
Finally, test the documented limits for code validity and failed attempts. Wait out the expiry window, then attempt to use the code; the system must reject it. Enter an incorrect code three times in a row. After this, a new code will need to be requested. Verify that your frontend displays a clear message prompting the user to request a new code after the third failure, rather than allowing further attempts.
Steps three and four: test hook responses and execution permissions
For Supabase auth hooks, inspect the default error behavior first. According to Supabase, if the error code is not set, the code is HTTP 500 Internal Server Error. Confirm your hook logic sets a specific error code to avoid this default state.
Check the database permissions. According to Supabase, allow the supabase_auth_admin role to execute the function.
Restrict access from other roles to maintain security. Verify that the anon, authenticated, and public roles cannot trigger the function directly.
Record the observed error codes in your test log. Compare these results against the expected HTTP codes. Ensure your client apps receive the correct error information when a non-200 code is returned. For more on error handling, see Signup api errors: 4 provider checks before retry.
Step five: test S256 handling and cached error responses
Verify your server-side implementation of RFC 7636 - Proof Key for Code Exchange by OAuth Public Clients by confirming it supports the S256 method, which the Internet Engineering Task Force designates as Mandatory To Implement (MTI) on the server. Your test plan should include a check to ensure your backend accepts this specific method during the authentication exchange.
Next, test how your client handles method downgrades. According to the Internet Engineering Task Force, clients MUST NOT downgrade to "plain" after trying the "S256" method. Your testing procedure should simulate a scenario where the S256 method is attempted and verify that the client does not subsequently fall back to the plain method. This check ensures your client logic adheres to the strict ordering rules defined in RFC 7636.
Finally, examine how your infrastructure caches error responses, specifically those with the 429 status code. The RFC Editor states that responses with the 429 status code MUST NOT be stored by a cache. You should test your caching layer to confirm it bypasses storage for these specific error codes. If your cache stores a 429 response, it violates the rule established in RFC 6585: Additional HTTP Status Codes.
Record the expected behavior for S256 support and 429 caching in your staging environment. Compare these expectations against the observed behavior during your test run. If your server rejects S256 or your cache stores 429 responses, update your configuration or code before releasing the new account flow.
Authentication behavior reference table by publisher
The following table lists the documented authentication rules for each provider. Each row is limited to the specific behaviors defined by that publisher's documentation.
| Publisher | Documented Behavior |
|---|---|
| Auth0 | Auth0 creates the user profile before authentication when a new user enters an OTP for the first time. Only the last issued OTP is accepted, and the latest code is invalidated once used. The OTP is valid for three minutes by default, and only three failed attempts are allowed before a new code must be requested. |
| Firebase | Firebase requires the function to respond within 7 seconds. HTTP response codes other than 200 are passed to client apps. |
| Supabase | Supabase sets the error code to HTTP 500 Internal Server Error if not set. The supabase_auth_admin role is allowed to execute the function, while permissions are revoked from other roles such as anon, authenticated, and public. |
| Internet Engineering Task Force | The Internet Engineering Task Force defines "S256" as Mandatory To Implement on the server. Clients must not downgrade to "plain" after trying the "S256" method. |
| RFC Editor | The RFC Editor specifies that responses with the 429 status code must not be stored by a cache. |
Record these documented behaviors alongside your observed test results in staging to verify your implementation matches the source specifications before release.
Illustrative example: a second code request
Suppose a tester requests an OTP at minute 0, then requests a second OTP at minute 1 before using the first code. Under the documented rule, only the second code should be accepted, so the first code should be rejected. The tester then enters the second code, which should succeed. Afterwards, the tester tries that same code again in a new session. The system should deny access, because the latest code is invalidated once used. Record each result in the log and compare it with the expected outcome. Your own test should use your configured expiry and attempt limits, not these example values.
Keep provider settings and observed test results on file
Create a simple log entry for every test you run. Include the date, the specific authentication method tested, and the outcome you observed. If you test the OTP lifecycle, record whether the code was accepted, rejected, or expired. If you test hook responses, note the HTTP status code returned and any error messages displayed to the client.
For the email path, note that Auth0 allows you to configure a Passwordless connection to send a one-time password (OTP) to a user through email to complete authentication. Write down the specific provider settings you used for this test so you can compare them against the observed results later.
Today, record the expected behavior for your first OTP test before running it in staging.
Related guides
FAQ: testing your own signup authentication flow
How do I run signup authentication testing before release?
Test the authentication methods and hooks your flow uses against their documented behavior, starting with the email OTP path where applicable. According to Auth0, you can configure a Passwordless connection to send a one-time password (OTP) to a user through email to complete authentication. Focus your staging tests on the specific components your signup flow actually uses rather than every possible authentication option.
Does the three-minute OTP expiry apply to my Auth0 email passwordless flow?
Yes, for the documented Auth0 email passwordless behavior, the OTP issued will be valid (by default) for three minutes before it expires. This time limit is specific to the Auth0 documentation for this authentication method. Verify this behavior in your staging environment to confirm the timing matches your user experience requirements.
What happens when someone requests another Auth0 OTP?
When a new code is issued, only the last OTP (or link) issued will be accepted. This replacement rule is documented in the Auth0 guide for passwordless authentication with email. Test this scenario to ensure your application handles the invalidation of the previous code correctly.
How quickly must the documented Firebase function respond?
For the documented blocking function workflow, your function must respond within 7 seconds. This timing requirement is specified in the Firebase documentation for extending authentication with blocking functions. Ensure your custom logic completes within this window to avoid timeouts during the authentication process.
Can a cache store an HTTP 429 response?
No, responses with the 429 status code MUST NOT be stored by a cache. This prohibition is defined in RFC 6585: Additional HTTP Status Codes | RFC Editor. Check your infrastructure to confirm that caching layers respect this rule for rate-limiting responses.