unique identities in cognito user pool

2

We are experimenting with cognito user pool. We set email or mobile number to be used as user name. We created user with email and mobile number. When we used the same email and mobile number for second user, cognito threw error. This is expected.

After the users are added to cognito with different user email and phone number, we updated the same mobile number and email, it doesn't threw any error. I launched the hosted UI from cognito portal and login with email and password, it picked one account and logged in.

This doesn't seem to be expected output.

  1. Why the cognito doesn't throw error when duplicate phone number is updated ?
  2. When we login using email how does the cognito picked the account ?
  • I'm also wondering how to ensure unique identities with federated login options. I setup a pool with email only and enabled Apple and Google sign in along with the ability to self-register. If I manually create a user in the pool and then Sign In with Apple or Google using the same e-mail, I end up with multiple users in the pool with the same verified email address.

질문됨 2년 전1826회 조회
1개 답변
1

Hi,

When email or phone is used as Alias, email and phone can be marked as verified to only one user in the user pool. If you attempt to assign the same phone/email to another user, you will be able to do so but you will not be able to mark it as verified (you will get an error if you attempt to verify the email/phone). You can force the verification to go through and this will mark the email/mobile for the other user as not-verified and will move the alias to the new user.

Cognito chooses the user with verified email/mobile when you attempt to sign-in using email/mobile.

AWS
전문가
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠