Share via

Smart Lockout for Email OTP validation in Entra External ID

Ulrik Ejdesgaard 0 Reputation points
2026-05-06T06:32:38.8733333+00:00

We are using Microsoft Entra External ID (CIAM, ciamlogin.com authority) with Email One Time Passcode as our primary authentication method in a sign-in user flow.

We have observed that when a user requests multiple OTP codes in succession, all previously generated codes appear to remain valid until they expire (30 minutes), meaning multiple active OTP codes can exist simultaneously for a single user. We have searched the documentation but could not find a definitive answer on either of the following security questions.

1. Does Smart Lockout apply to failed OTP validation attempts?

Will an account be locked out after repeated incorrect OTP guesses, the same way it would for repeated incorrect password attempts? Or does Smart Lockout only apply to password-based authentication flows?

2. Is multiple simultaneously valid OTP codes by design?

If so, what built-in protections exist to prevent an attacker from generating a large number of valid OTP codes and using them to increase their chances of guessing a valid code via brute force? With a 8-digit OTP and a 30-minute validity window, the theoretical attack surface seems non-trivial if no lockout or rate limiting mechanism applies to validation attempts.

We would appreciate a reference to official documentation if available.

Environment:

  • Tenant type: Entra External ID (CIAM), ciamlogin.com authority
  • Authentication method: Email One Time Passcode
  • User flow type: Sign-in (no self sign-up)
Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-05-06T06:33:07.4233333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more
    1. Smart lockout and OTP validation

    Smart lockout, as documented, is a password protection feature that applies to password-based sign-in attempts. It tracks failed password attempts, uses bad password hash tracking, and locks accounts based on configurable lockout thresholds and durations.

    All available documentation in the provided context describes Smart lockout only in relation to password-based authentication (for example, sign-ins where a password is entered and validated by Microsoft Entra ID or on-premises AD via pass-through authentication). There is no indication in the provided documentation that Smart lockout applies to email one-time passcode (OTP) validation attempts.

    Therefore, based on the documentation in scope, Smart lockout is a password-focused control and is not described as applying to email OTP verification failures.

    1. Multiple simultaneously valid OTP codes and protections

    For native authentication with email one-time passcode, the documented behavior is:

    • After the app verifies the user's email with OTP, it receives tokens.
    • If delivery of the OTP is delayed or not delivered, the user can request another OTP.
    • When Microsoft Entra resends a one-time passcode, it invalidates the previously sent code if it has not yet been verified.

    This means that, for the documented native auth email OTP flow, multiple simultaneously valid OTPs for the same user are not expected: when a new OTP is sent, any previous unverified OTP is invalidated.

    The documentation in scope does not describe additional rate limiting or lockout behavior specific to email OTP verification attempts beyond this “resend invalidates previous code” behavior, nor does it describe multiple concurrently valid OTPs as a supported or intended behavior.

    Related protections for OTP-based and sign-up/sign-in scenarios in External ID that are documented include:

    • Sign-up protection controls such as:
      • WAF bot protection to block high-volume automated OTP triggering.
      • Reputation-based email filtering via custom extensions.
      • IP-based filtering and reputation checks via custom extensions.
      • Monitoring and alerting on excessive OTPs from a single IP/ASN or location.
    • Sign-up error handling and specific OTP-related error codes (for example, 50181 for “Unable to validate the OTP” and 50182 for “OTP is already expired”), with guidance for users to request a new OTP.

    These controls are focused on reducing automated abuse and fraud in OTP-based flows, but the provided documentation does not explicitly describe:

    • Smart lockout being applied to OTP validation failures.
    • A built-in lockout or rate limit specifically on OTP validation attempts for sign-in.

    If behavior in a specific CIAM user flow appears to differ from the documented native auth behavior (for example, multiple OTPs seemingly valid at once), the next step, per the sign-up troubleshooting guidance, is to collect sign-up/sign-in logs and error codes and then open a support request for further investigation.


    References:

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.