Share via

How to distinguish OTP requests types to send different email templates?

Jinki Lee 85 Reputation points
2026-05-07T14:44:15.0933333+00:00

How to get these different "request types" in my OTP payload?

"authenticationContext": { "requestType": "signUp" | "signIn" | "passwordReset"

When I trigger the "reset password" flow: /resetpassword/v1.0/start --> /resetpassword/v1.0/challenge, I get a payload which is showing this: "requestType": "signIn"

And then when I trigger the "sign up" flow: /signup/v1.0/start --> /signup/v1.0/challenge , I still get a payload which is showing this: "requestType": "signIn"

My main goal is to have my function app send out different one time passcode email templates for different events such as "reset password", "sign up", "change username confirmation", etc.

According to my previous post/solution, this is possible: https://learn.microsoft.com/en-us/answers/questions/5622786/how-to-get-otp-code-in-completely-customized-email

Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Most helpful
  1. VEMULA SRISAI 13,025 Reputation points Microsoft External Staff Moderator
    2026-05-07T16:08:34.8166667+00:00

    Hello Jinki Lee,

    At present, you cannot rely on authenticationContext.requestType to differentiate OTP scenarios when using Native Authentication. Although the documentation mentions values like signUp and passwordReset, the service currently sends requestType = signIn for all email OTP challenges, including sign‑up and reset password flows.

    This is a known service behavior/limitation, not an issue with your Function App implementation. There is no supported or documented way today to distinguish OTP intent (sign‑up vs reset password vs others) from the email OTP payload.

    Additionally:

    • Only signUp, signIn, and passwordReset are documented
    • Scenarios like change username confirmation are not exposed via a distinct requestType
    • No alternate context field is currently provided to infer the exact flow

    Conclusion: Different email templates cannot be reliably selected based on OTP request type today. You would need to use a common template or introduce an external workaround (for example, separate tenant/app or out‑of‑band logic).

    Was this answer helpful?

    1 person found this answer helpful.

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.