0

I cannot figure out how to have my user in a react-native app being able to use both Cognito and a social provider like Facebook.

Let say the user first start by creating a username with password. And later decided to connect his account with is Facebook. I would like to allow him to log in just by using the Facebook button and not having to enter again. email + password.

Thanks.

James
  • 5,635
  • 2
  • 33
  • 44
efleurine
  • 176
  • 1
  • 6
  • Just to clarify.. Are you trying to allow the user to use either Cognito or a Social Provider, or have a specified default? Lines 1 and 2 seem a little conflicting. – KiteCoder Jul 19 '18 at 14:15
  • 1) users register with email and password first. => this go to Cognito 2) users link their account to facebook. I would like at this point stop asking for email+password to login back and only use the facebook login to sign the user in the system. It's the same user but with 2 ways to login. – efleurine Jul 19 '18 at 16:23

1 Answers1

0

Unfortunately you won't be able to do something like that, and if you do really need to do that, your best bet would not to go through Cognito.

The way Cognito User Pools works is that if a user is signed up to a user pool with a username and password, that user can only sign in with that username and password along with an email or phone number alias if you set that up in User Pools. AWS does not allow switching the authentication method.

Jonathan Wong
  • 460
  • 5
  • 11