3

i want to know how to create user entry in user pool when user login with facebook. I am able to integrate aws cognito up and the facebook log in just fine but user is not creating in user pool when login with facebook. identity Id is creating in default facebook group.

Map<String, String> logins = new HashMap<String, String>();
logins.put("graph.facebook.com", 
AccessToken.getCurrentAccessToken().getToken());
                credentialsProvider.setLogins(logins);
                credentialsProvider.refresh();

1 Answers1

2

If I understand correctly, you want to integrate Social Identity Providers with a User Pool and you have successfully integrated Social Identity Providers as Federated Identities.

There has been some discussion on this topic. I would recommend starting here: AWS cognito: sign in with usernam/password OR facebook

Since this discussion, AWS has added support to Add Social Identity Providers to a User Pool Which would allow you to use augment social identities as part of an AWS managed user pool. If you still want to federate with the social identity, rather than your user pool, you will need to create a way to manage identities.

KiteCoder
  • 2,364
  • 1
  • 13
  • 29
  • Hi @KiteCoder, I appreciate your answer. If I am not wrong, you are sharing Web based facebook auth instead of Android based. But I am looking for Android integration. Right now I can login to facebook and add user to userpool via android webview. But it redirect me to localhost:4200#access_token=....?id_token_=...., which not applicable for android app. It will redirect me to an predefined activity. Can you share any link / solution based on android. Again thanks for your assistance. – Saiful Azad Feb 05 '19 at 04:23
  • Hi @KiteCoder, If i want to add users in dynamoDB from User Pool. – jaspreet singh Feb 05 '19 at 11:47
  • @SaifulAzad That is correct, this is a web based auth documentation. I would recommend using the AWS-Amplify Library. Documentation for Android: https://aws-amplify.github.io/docs/android/authentication. Please remember this documentation is for a federated sign in, and the "User Pool" aspect will be managed by the third party (Facebook) not AWS User Pools – KiteCoder Feb 05 '19 at 16:15