# How to know which MFA factor was used, synchronously at token issuance (not via async log queries)?

**URL:** <https://community.auth0.com/t/how-to-know-which-mfa-factor-was-used-synchronously-at-token-issuance-not-via-async-log-queries/201219>\
**Category:** Get Help\
**Tags:** mfa-api, mfa\
**Created:** [June 29, 2026, 1:45pm UTC](https://community.auth0.com/t/how-to-know-which-mfa-factor-was-used-synchronously-at-token-issuance-not-via-async-log-queries/201219 "2026-06-29T13:45:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadav.beladev](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nadav.beladev/32/79284_2.png) [@nadav.beladev](https://community.auth0.com/u/nadav.beladev)\
**Post date:** [June 29, 2026, 1:45pm UTC](https://community.auth0.com/t/how-to-know-which-mfa-factor-was-used-synchronously-at-token-issuance-not-via-async-log-queries/201219/1 "2026-06-29T13:45:37Z")

</div>

We’re using New Universal Login with a custom domain.

After login, we trigger step-up MFA from a Post-Login Action:

`api.multifactor.enable('any', { allowRememberBrowser: false })`

At the callback, we verify the tokens on the server side.

I’m trying to determine the MFA factor the user completed, for example, WebAuthn, OTP, or Push, synchronously during the login/token issuance flow.

I’ve already confirmed that:

- `event.authentication.methods` only shows `{ name: "mfa", timestamp }`

- `amr` only includes `"mfa"`, not the specific factor

- `challengeWith` / `challengeWithAny` Resume in the next Action, but still only expose `"mfa"`

- Management API logs do show the factor, but they are async.

Is there any supported synchronous way to access the completed MFA factor and surface it as a token claim, or is the only supported option to either rely on Management API logs or force a single factor with `challengeWith({ type })`?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [June 29, 2026, 10:45pm UTC](https://community.auth0.com/t/how-to-know-which-mfa-factor-was-used-synchronously-at-token-issuance-not-via-async-log-queries/201219/3 "2026-06-29T22:45:03Z")

</div>

Hi @nadav.beladev

Yes, there **is a supported synchronous way** to access the specific completed MFA factor (e.g., `webauthn-platform`, `otp`, `push-notification`) and surface it as a token claim.

However, you **cannot** use `api.multifactor.enable()` to achieve this. You must use the pipeline-pausing `api.authentication.challengeWithAny()` method in one Action, and then read the explicitly documented `type` property from `event.authentication.methods` in a **second, subsequent Action**.

To get the granular factor synchronously, you must explicitly take control of the MFA routing using the newer `challengeWith` / `challengeWithAny` commands. These commands uniquely **pause the Action flow** , challenge the user, and then **resume the flow** , populating the exact factor used.

According to the [Auth0 Custom MFA Selection Documentation](https://www.google.com/url?q=https%3A%2F%2Fauth0.com%2Fdocs%2Fsecure%2Fmulti-factor-authentication%2Fcustomize-mfa%2Fcustomize-mfa-selection-universal-login "https://auth0.com/docs/secure/multi-factor-authentication/customize-mfa/customize-mfa-selection-universal-login"):

> _ **"The array** _ `event.authentication.methods` _ **includes a** _ `type` _ **field when the name of the method is set to** _ `mfa`_ **.** _ `type` _ **is a string that contains factor values… When an MFA challenge is performed, methods contains an object of name:mfa with** _ `type` _ **set to the factor used for that challenge.** _ **To see the results of a challenge, methods must be accessed in the next Action in the flow._"_**

**[SOLUTION]**

**Step 1: Action 1 (The Trigger)**  
In your first Action, you trigger the challenge and pause the pipeline:

```auto
exports.onExecutePostLogin = async (event, api) => {
  // Trigger step-up and PAUSE the pipeline
  api.authentication.challengeWithAny([
    { type: 'webauthn-platform' },
    { type: 'otp' },
    { type: 'push-notification' }
  ]);
};

```

**Step 2: Action 2 (The Token Injection)**  
You must create a **completely separate Action** and place it _after_ Action 1 in your Login Flow pipeline. When the pipeline resumes, this Action executes, and the `type` property will be populated:

```auto
exports.onExecutePostLogin = async (event, api) => {
  // Find the MFA method in the array
  const mfaMethod = event.authentication.methods.find(m => m.name === 'mfa');

  if (mfaMethod && mfaMethod.type) {
    // mfaMethod.type will be 'otp', 'webauthn-platform', etc.
    const completedFactor = mfaMethod.type;
    
    //Surface it to your application
    api.idToken.setCustomClaim('https://yourdomain.com/mfa_factor', completedFactor);
    api.accessToken.setCustomClaim('https://yourdomain.com/mfa_factor', completedFactor);
  }
};

```

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 13, 2026, 10:45pm UTC](https://community.auth0.com/t/how-to-know-which-mfa-factor-was-used-synchronously-at-token-issuance-not-via-async-log-queries/201219/4 "2026-07-13T22:45:13Z")

</div>

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