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 24 hours.
How to use it:
- Use the email address provided by the Bright web app.
- 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:
- Open the AUTHENTICATIONS tab โ Click + Create authentication โ Open the Advanced tab
- To create a new Email OTP, click + Add OTP:
- Then, select the Email OTP type from the list below:
- Specify the following fields:
- Name: use alphanumeric symbols and the underscore (_) to customize the OTP name, if needed
- Subject regex: use your subject from the email, for example:
Your OTP code
- 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.
- Click Create to proceed, you won't be able to get an email address without creating the authentication object.
-
Now you should edit this authentication object to get the email address:
-
Now go back to the Advanced tab and expand the OTP you are setting.
Note, this email address is generated automatically and not customizable.
-
Go to the Auth flow setup tab and configure the stage. For this example, we will describe a simple case of the Manual Browser-Based Form Authentication for the brokencrystals.com. In this example, the extracted value from an email will be pasted to the Password text field. Use this code to reference the Name field OTP settings:
{{ auth_objects.otps.token1 }}
. -
Now click the Test authentication button to proceed.
As you can see in the screenshot, an OTP code was successfully extracted from the email and pasted to the test login page.
If you want to clone the Authentication Object with Email OTP, save it before testing. Otherwise, the new email won't be generated.
Updated about 2 months ago