I am new to Amazon AWS cognito. can someone help to implement the facebook login on cognito. I have finished the steps give by cognito got logged in facebook and send that access token to cognito. Here is my code.
fblogin() {
this.fb.login()
.then((res: LoginResponse) => {
console.log('cognito identitypole-->',CognitoUtil._IDENTITY_POOL_ID);
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: CognitoUtil._IDENTITY_POOL_ID,
Logins: {
'graph.facebook.com': res.authResponse.accessToken,
}
});
})
.catch(this.handleError);
}
After this i dont have idea how to get registered in cognito using angular 2.
Any idea to implement facebook registration and login on cognito using angular 2
Thanks in advance
Cognito have
User Pool
andFederated Identities
. If you are using federated identities, it won't create a user in theUser Pool
Federated Identities
is like giving the user an access to your service without them having an account.For Federated Sign in via AWS Amplify (client side)
Link: https://aws-amplify.github.io/docs/js/authentication
I suggest using
AWS Amplify
for client side AWS Cognito usage.If you want users to have an account to your user pool when they sign up via Facebook or Google, I think Cognito's Hosted UI supports it but if you have your own UI, you will have a different approach. A question related to this: Using Cognito User Pools, without Cognito Federated Identities(identity pools)