Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For MFA, how to select the second SMS phone number? #1540

Open
alex-sh-wu opened this issue Sep 18, 2024 · 0 comments
Open

For MFA, how to select the second SMS phone number? #1540

alex-sh-wu opened this issue Sep 18, 2024 · 0 comments
Labels

Comments

@alex-sh-wu
Copy link

Describe the bug

I am using the IDX API of the Okta Auth JS library. I am following the steps in the On-Demand section from here: https://github.com/okta/okta-auth-js/blob/master/docs/idx.md#idxauthenticate

I am currently using this API with a user that has 1 email factor and 2 phone factors. When I login with this user's credentials with authClient.idx.authenticate(), I am presented with a status PENDING with the following data in the nextStep attribute:

{
   inputs: [
      name: "authenticator",
      options: [
         {label: "Email", value: "okta_email"},
         {label: "Phone", value: "phone_number"},
         {label: "Phone", value: "phone_number"},
      ]
   ],
   name: "select-authenticator-authenticate"
}

When I proceed to the next step with

authClient.idx.authenticate({ authenticator: "phone_number", methodType: "sms" });

the SMS always gets sent to the user's first phone number, and even if I pass in other attributes like id or enrollmentId, I can't send the SMS to the second phone number instead. What should I be passing in so that the SMS can be sent to the second phone number instead of the first phone number?

Reproduction Steps?

// start the flow with a user that has one email enrolled and two phone numbers enrolled
const { 
  status, // IdxStatus.PENDING
  nextStep: { 
    inputs, // [{ name: 'authenticator', ... }]
  }
} = await authClient.idx.authenticate({ username: 'xxx',  password: 'xxx' });

// a list of authenticators is shown and the user selects "phone_number"
const { 
  status, // IdxStatus.PENDING
  nextStep: { 
    inputs // [{ name: 'verificationCode', ... }]
  }
} = await authClient.idx.proceed({ authenticator: AuthenticatorKey.PHONE_NUMBER, methodType: "sms" });
// user will receive SMS on the first phone number, but not the second
// passing in parameters like "id" or "enrollmentId" does not change the phone number selection

SDK Versions

7.8.0

Additional Information?

IDX Documentation: https://github.com/okta/okta-auth-js/blob/master/docs/idx.md#idxauthenticate

@alex-sh-wu alex-sh-wu added the bug label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant