# Hardcoded OTP for Automating test cases

**URL:** <https://community.auth0.com/t/hardcoded-otp-for-automating-test-cases/184058>\
**Category:** Get Help\
**Tags:** platform-infrastructure, general-architecture-question\
**Created:** [March 18, 2025, 2:50pm UTC](https://community.auth0.com/t/hardcoded-otp-for-automating-test-cases/184058 "2025-03-18T14:50:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kushankurxd](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kushankurxd/32/71332_2.png) [@kushankurxd](https://community.auth0.com/u/kushankurxd)\
**Post date:** [March 18, 2025, 2:50pm UTC](https://community.auth0.com/t/hardcoded-otp-for-automating-test-cases/184058/1 "2025-03-18T14:50:06Z")

</div>

For automating authentication test cases, we previously used email + a hardcoded OTP. How can we achieve the same in Auth0’s passwordless login? Is there a way to modify the triggers to facilitate this, or is there a better approach for automating the process? Would love to hear your thoughts on the ideal way to implement this.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [March 18, 2025, 9:04pm UTC](https://community.auth0.com/t/hardcoded-otp-for-automating-test-cases/184058/3 "2025-03-18T21:04:37Z")

</div>

Hi @kushankurxd

Welcome to the Auth0 Community!

I believe that you can implement an automated system for testing cases, using a hardcoded OTP, via [Passwordless Authentication with Email](https://auth0.com/docs/authenticate/passwordless/authentication-methods/email-otp) and [Configure a Custom Email Provider](https://auth0.com/docs/customize/email/configure-a-custom-email-provider).

This will require a custom script that would call the Auth0 API endpoint to have a code sent to the specified email address, then access the inbox of that address to retrieve the code and use it to complete the authentication process.

Hope this helps!  
Gerald

---

<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:** [April 1, 2025, 9:05pm UTC](https://community.auth0.com/t/hardcoded-otp-for-automating-test-cases/184058/4 "2025-04-01T21:05:14Z")

</div>

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