Enchanted Link with Flows
This guide will walk you through integrating enchanted link based authentication into your Descope Flows. Enchanted Links allow your users to authenticate across devices with a single click of a button, sent directly to their email address, by matching a number displayed during the login process.
If you wish to use Enchanted Links with flows, this page explains how to use all of the various Flow functions related to Enchanted Link. To learn more about Enchanted Link, visit our main section on it above.
Flow Actions
When using Enchanted Link, you have the standard actions for most authentication methods available.
- Sign Up / Enchanted Link - Signs the user up, but will not work if user already exists
- Sign Up or In / Enchanted Link - Signs the user in, and if user doesn't exist it will automatically sign them up
- Sign In / Enchanted Link - Signs the user in, but if the user doesn't exist it will fail.
- Update User / Enchanted Link - Will merge OAuth identity to an existing user
How to Use Enchanted Link 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 Enchanted Link, there will typically be a screen present for polling, with a horizontal scrolling sidebar, as part of the actions listed above. All you need to do to use enchanted links, is to connect the actions to a screen that has a Custom Login ID, Email, or Phone input.
There's also a way of knowing where the user started the flow, so once successfully authenticated, a Descoper can add the user agent's name using the context key userAgent
.
You can add this in your "Verified Successfully" screen of your flow.
Error Handling
Error handling is handled like any other action. You can refer to our Flow Error Handling guide for more details.