2FA on IMAP Email

Hi,
I have this process:

  • I have a website
  • I log with user and psw
  • I get an otp on a mail that I can read with IMAP
  • I need to read the code and write into the page to continue log in

Any suggestion/tutorial to deal with this scenario?

Hi @Erradish

Fallow the steps below:

  1. Connect to IMAP

  2. Get IMAP Mail Messages

  3. For Each mail in mails:
    a. If mail.Subject.Contains(“Your OTP Subject”):
    i. Use Regex to extract OTP
    For example:
    Create variable otpCode
    Use the activity Assign
    otpCode = System.Text.RegularExpressions.Regex.Match(mail.Body.ToString(), “\d{6}”).Value

  4. Type Into “OTP Input Field” with extracted OTP

  5. Click “Login Button”

1 Like

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