# Check if possible: Auto-Send OTP via Email Upon Redirect

**URL:** <https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [January 22, 2025, 11:04am UTC](https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744 "2025-01-22T11:04:44Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robertdhero](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robertdhero/32/39425_2.png) [@robertdhero](https://community.auth0.com/u/robertdhero)\
**Post date:** [January 22, 2025, 11:04am UTC](https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744/1 "2025-01-22T11:04:44Z")

</div>

Dear Auth0 Team,

I am exploring the feasibility of implementing the following passwordless login experience and would like your guidance on whether this is possible with Auth0:

1. An after-care provider (whose email is already registered in my marketplace, but not might have an account yet in Auth0) receives a custom link ( **URL**?email=after@careprovider.com) to access a hospital’s patient file on our platform, secured by an Auth0 login.

2. Upon clicking the “View File” link in the email:

- **Scenario 1:** If the provider is already logged in, they are immediately shown the patient file.
- **Scenario 2:** If the provider is not logged in, they are presented with a panel (= step 2 in the universal login - passwordless) to enter a one-time code, which was automatically _ **sent to their known email address upon redirect when scenario 2 was detected** _.

1. Upon successful validation of the code, the patient file is displayed.

Could you please confirm if this flow can be implemented using Auth0? If so, I would appreciate any relevant documentation or guidance to help me get started.

Thank you for your assistance!

PS: I’m dealing with sensitive data - if this seems not a secure way to send data (instead of using email attachments) please raise your concerns. In that case I will find another solution.

---

<div class="post-metadata">

**Author:** ![sumansaurav](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sumansaurav/32/70627_2.png) [@sumansaurav](https://community.auth0.com/u/sumansaurav)\
**Post date:** [January 22, 2025, 3:29pm UTC](https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744/2 "2025-01-22T15:29:08Z")

</div>

This approach is actually more secure than email attachments because:

- Authentication is required before accessing data
- Data never leaves your secure environment
- Access can be revoked at any time
- You maintain an audit trail of access

If I understand correctly, this is what you want to achieve. I have added both scenario in the high level diagram.

 ![image](https://global.discourse-cdn.com/auth0/original/3X/0/3/03136fd094d121493db0fd15535f8bca2ce5b853.png)

You can find Passwordless Authentication with Email here:

> **[Passwordless Authentication with Email](https://auth0.com/docs/authenticate/passwordless/authentication-methods/email-otp)**
>
> Learn how how to use Passwordless connections with the email authentication factor.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![robertdhero](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/robertdhero/32/39425_2.png) [@robertdhero](https://community.auth0.com/u/robertdhero)\
**Post date:** [January 22, 2025, 5:38pm UTC](https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744/3 "2025-01-22T17:38:33Z")

</div>

Thank you for visualizing the flow—it’s spot on!

After reviewing the documentation further, it seems we need to take the custom route for this:

[Auth0: Relevant API Endpoints for Embedded Login](https://auth0.com/docs/authenticate/passwordless/implement-login/embedded-login/relevant-api-endpoints)

By going this route, we can develop a custom frontend page that addresses both Scenario 1 and Scenario 2, potentially incorporating a tailored UI on our platform to handle unlocking the patient file seamlessly.

From what I understand, this functionality isn’t available out of the box—would you agree?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [February 5, 2025, 5:38pm UTC](https://community.auth0.com/t/check-if-possible-auto-send-otp-via-email-upon-redirect/169744/4 "2025-02-05T17:38:51Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
