---
updatedAt: 2026-01-29T13:06:06.000Z
agentTools:
  projectIndex: https://docs.brightsec.com/llms.txt
---

# Email OTP

Email One-Time Password (OTP) is a temporary password sent to a generated email address used by Bright to authenticate to applications. Bright provides an email address that cannot be customized. Emails are automatically deleted after 7 days.

How to use it:

1. Use the email address provided by the Bright web app.
2. Set this email as the test user's email.

> 👍 If you can't use the provided email due to restrictions, set up forwarding from your local email to the Bright-provided address.

To set up the Email OTP, do the following:

1. Open the **AUTHENTICATIONS** tab → Click **+ Create authentication** → Open the **Advanced** tab.

2. To create a new Email OTP, click **+ Add OTP**:

   <Image align="center" border={false} src="https://files.readme.io/e6b44bd-2.png" />

3. Then, select the **Email OTP** type from the list below:

   <Image align="center" border={false} src="https://files.readme.io/208bb0e-4.png" />

4. Specify the following fields:
   1. **Name**: use alphanumeric symbols and the underscore (\_) to customize the OTP name, if needed.
   2. **Subject regex**: use your subject from the email, for example: `Your OTP code`.
   3. **Body OTP regex**: this parameter controls where the Bright engine will find the code in the email. Use a capturing group to locate a code in the email. For example, here's the regex for a 6-digit code: `(\d{6})`. The search is first done in the plain-text body and then in HTML.

5. Click **Create** to proceed, you won't be able to get an email address without creating the authentication object.

   <Image align="center" border={false} src="https://files.readme.io/f7fdd68-5.png" />

6. Now you should edit this authentication object to get the email address:

   <Image border={false} src="https://files.readme.io/8b6b2013749646ef83e935261fb004ab44ce87c8683d337f62fc286f44b6eff0-image.png" />

7. Now go back to the **Advanced** tab and expand the OTP you are setting.

   > 📘 Note, this email address is generated automatically and is not customizable.

   <Image align="center" border={false} src="https://files.readme.io/a114e12-7.png" />

8. Go to the **Auth flow setup** tab and modify the relevant value to use the OTP reference. If the name of the OTP token is `token1`, the value you should use is: `{{ auth_object.otps.token1 }}`.

   <Image align="center" border={false} src="https://files.readme.io/d665e5b-Monosnap_Authentications__Bright_Security_2024-08-19_09-36-03.png" />

<br />

> 🚧 If you want to clone the Authentication Object with Email OTP, save it before testing. Otherwise, a new email address won't be generated.