Hi @nlthoelen
Welcome back to the Auth0 community!
You are trying to configure OTP (One-Time Password) authentication on your email-password database connection in Auth0, but when you attempt to patch the connection using the Management API to add OTP to the authentication_methods property, you receive the error: “OTP authentication methods feature is not supported for this connection.”
OTP authentication methods cannot be added directly to a database connection. OTP is only supported as a passwordless authentication method on a separate passwordless email connection, not as an authentication method on a standard database connection. This is an architectural limitation in Auth0, not a configuration issue or a free-tier restriction.
[Root Cause]
Auth0 distinguishes between two separate connection types for email-based authentication:
-
Database Connection (Username-Password-Authentication): Stores user credentials (email and password) and supports password-based authentication. This connection type does not support OTP as an authentication method.
-
Passwordless Email Connection: A separate connection type designed specifically for passwordless authentication flows. This connection supports OTP (one-time password) as the primary authentication mechanism.
When you set “Email as identifier” on your database connection and configure “Verification method to OTP” in the Email settings, you are configuring email verification for new user signups, not passwordless OTP authentication. These are different features:
- Email verification with OTP: Sends an OTP to verify a user’s email address during signup, but the user still logs in with their password.
- Passwordless OTP authentication: Users log in using only an OTP sent to their email, without a password.
The error “OTP authentication methods feature is not supported for this connection” occurs because you are attempting to add OTP as an authentication method to a database connection, which is not supported. OTP authentication methods are only available on passwordless connections.
Recommended Approach:
To offer OTP as an authentication option to your users, you have two choices:
Option 1: Keep password authentication and add passwordless OTP as an alternative (Recommended)
- Keep your existing database connection for email-password authentication.
- Create a separate passwordless email connection for OTP-only authentication.
- Enable both connections on your application so users can choose to log in with either password or OTP.
- In your Universal Login UI, present both options: “Login with Password” and “Login with OTP”.
Steps:
- Navigate to Auth0 Dashboard → Connections → Passwordless.
- Click Email and ensure it is enabled.
- Configure the email provider (you have already done this with Mailgun).
- Navigate to Applications → Your Application → Connections.
- Enable both your database connection and the passwordless email connection for your application.
- In your Universal Login, allow users to choose between password and OTP login methods.
Option 2: Replace password authentication with passwordless OTP only
If you want to remove password authentication entirely and use only OTP:
- Disable the database connection on your application.
- Enable only the passwordless email connection on your application.
- Users will log in exclusively with OTP sent to their email.
Steps:
- Navigate to Auth0 Dashboard → Applications → Your Application → Connections.
- Disable the database connection (toggle off).
- Enable the passwordless email connection (toggle on).
Additionally, if you wish to use only the passwordless connection in your application, you have the option to pass the “connection=email” parameter inside the authorize call in order to force the users to authenticate only using email OTP.
Verification:
After enabling the passwordless email connection on your application, you should see it available in your Universal Login flow. The connection will support OTP-based authentication without requiring users to have a password.
Kind Regards,
Nik