User authentication with OTP

Trying to figure out how I can use OTP based authentication with bubble. Here’s the desired flow:

  1. Admin user creates a “Customer User” with email
  2. Customer User enters their email on a login page
  3. Customer User receives a One Time Code through Twilio (Via API)
  4. Customer User enters the Code on the login page
  5. They are authenticated.

The issue I’m facing is how do I create an account for a user, which they can authenticate against without a password. Here’s what I’ve tried and the issues I’ve faced:

  1. “Create an account for someone else” + Magic Link = Authentication works, but we ran into several issues with corporate firewalls invalidating the link
  2. “Create an account for someone else” + “Assign Temp password” = Don’t have a way to then log the user in, when they provide the correct OTP, since “Log the user in” requires a password.

Would love to hear if anyone has implemented a workable solution.

PS - We’re following best practices with Twilio, meaning we don’t have access to the exact code sent to the user.

1 Like

Hi, in this use case, do you want the OTP method to be the default login method? Or you just want this to be a way to verify said user accounts for the first time?

I’d like it to be the default login method.

The first approach should work to some extent. What was the error you were getting? Was it a bubble side error or twilio side error?

You mean the magic link approach? Twilio is not involved in this approach. Its all bubble. The error was about the link being expired.