OTP with Flows
This guide will walk you through integrating OTP-based authentication into your Descope Flows. One Time Passwords (OTPs) allow your users to authenticate using a code sent to their devices, either in an email or as an SMS, without the need for a password.
Flow Actions
When using OTP Login, you have the standard actions for most authentication methods available.
- Sign Up / OTP - Signs the user up, but will not work if user already exists
- Sign Up or In / OTP - Signs the user in, and if user doesn't exist it will automatically sign them up
- Sign In / OTP - Signs the user in, but if the user doesn't exist it will fail.
- Update User / OTP - Will merge the OTP user to an existing user
How to Use OTP Actions
To learn more about Actions in general, you can refer to our guide on them.
Most of these actions are pretty simple, and you can drop them in your application like any other Action.
This is an example of using the Sign Up or In action in a flow:
Flow Screens
When using OTP, there will typically be a screen where you input your OTP code, which is included as part of the actions above. All you need to do to use OTP, is to connect the actions to a screen that has a Custom Login ID, Email, or Phone input.
Error Handling
Error handling is handled like any other action. You can refer to our Flow Error Handling guide for more details.