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

Auth v6 - Sign-in - Invalid phone number format. #13761

Closed
3 tasks done
hanoj-budime opened this issue Aug 28, 2024 · 5 comments
Closed
3 tasks done

Auth v6 - Sign-in - Invalid phone number format. #13761

hanoj-budime opened this issue Aug 28, 2024 · 5 comments
Assignees
Labels
Auth Related to Auth components/category question General question

Comments

@hanoj-budime
Copy link

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

None

Environment information

....

Describe the bug

Amplify checks phone_number is required during / once user migrated ?

During user migration required phone_number which is missing but user is mirgrated succesfully from one pool to other pool.
However sign-in failed with InvalidParameterException ( Invalid phone number format. )

image

Expected behavior

Amplify must improve nextstep like CONFIRM_SIGN_IN_WITH_REQUIRED ( where in-case phone_number will be required for MFA sign-in )

Reproduction steps

  1. auth v6.5
  2. User Mirgation from old-pool to new-pool
  3. In old-pool phone_number is not required.
  4. In new-pool phobe_number is required ( for MFA sign-in ) .

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@hanoj-budime hanoj-budime added the pending-triage Issue is pending triage label Aug 28, 2024
@cwomack cwomack added the Auth Related to Auth components/category label Aug 28, 2024
@cwomack cwomack self-assigned this Aug 28, 2024
@cwomack
Copy link
Member

cwomack commented Aug 28, 2024

Hello, @hanoj-budime 👋. Is this happening after upgrading from v5 of Amplify to v6? I believe this is the error you'd experience if you're trying to call the newer API using the Auth.confirmSignIn() parameters. If so, there are changes to the confirmSignIn() parameters to include an object with a challengeResponse property rather than separate ones for user and code (like in v5). More information on the differences can be found here in the docs.

Can you see if calling the API like shown below helps resolve the issue?

await confirmSignIn({ challengeResponse: "123456" });

@cwomack cwomack added question General question pending-response and removed pending-triage Issue is pending triage labels Aug 28, 2024
@hanoj-budime
Copy link
Author

hanoj-budime commented Sep 3, 2024

@cwomack

Amplify checks phone_number is required during user migrated ?

During user migration required phone_number which is missing but user is mirgrated succesfully from one pool to other pool.
However sign-in failed with InvalidParameterException ( Invalid phone number format. )

error at

  await signIn({ username, password, options });

image

@cwomack cwomack added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-response labels Sep 9, 2024
@israx
Copy link
Member

israx commented Sep 9, 2024

hello @hanoj-budime. Sorry for any inconvenience using the library.

The Invalid phone number format error message is due to providing an incorrect phone_number format either during signUp or signIn.

Bad:
signIn({username:"9990009999", password:*****}

Good:
signIn({username:"+19990009999", password:*****}

Also, are both of your user pools configured to login with phone_number, or/and do they require a phone_number attribute during signUp?

@github-actions github-actions bot removed the pending-maintainer-response Issue is pending a response from the Amplify team. label Sep 9, 2024
@cwomack
Copy link
Member

cwomack commented Sep 24, 2024

@hanoj-budime, wanted to check in and see if @israx's comment above helped unblock you or if you're still experiencing this. The Cognito docs on the phone_number attribute go into a little more detail about the necessary formats that are critical for user pools. Let us know if this helps clear things up!
Screenshot 2024-09-24 at 3 04 40 PM

@cwomack cwomack added the pending-community-response Issue is pending a response from the author or community. label Sep 24, 2024
@cwomack
Copy link
Member

cwomack commented Oct 1, 2024

Closing this issue as we have not heard back from you. If you are still experiencing this, please feel free to reply back and provide any information previously requested and we'd be happy to re-open the issue.

Thank you!

@cwomack cwomack closed this as completed Oct 1, 2024
@github-actions github-actions bot removed the pending-community-response Issue is pending a response from the author or community. label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auth Related to Auth components/category question General question
Projects
None yet
Development

No branches or pull requests

3 participants