amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
986 stars 452 forks source link

How to save a Facebook/Google User into the Userpool using custom UI? #626

Closed joe455 closed 6 years ago

joe455 commented 6 years ago

I am creating a app with angular4 with custom UI and JS SDK. Now I want to save my facebook user into userpool.For now my code looks like below.

`let params = { IdentityPoolId: CognitoUtil._IDENTITY_POOL_ID, / required / Logins: logins };

        let creds:AWS.CognitoIdentityCredentials = new AWS.CognitoIdentityCredentials(params);

        console.log("creds",creds);

        creds.get(function(err) {
          if (err) return console.log("Error", err);
          else {
            console.log("Sucuessfully ");
           console.log("Cognito Identity Id", creds.identityId);
           console.log("token",creds.sessionToken);
          }
        });`

Now I want to store this user into userpool.

itrestian commented 6 years ago

You are using Cognito Identity to federate users into Cognito Federated Identities in order to get AWS credentials. You want to use Federation for User Pools to federate Facebook users into your user pool.

https://github.com/aws/amazon-cognito-auth-js

joe455 commented 6 years ago

@itrestian Any example?

itrestian commented 6 years ago

Closing this as duplicate https://github.com/aws/amazon-cognito-auth-js/issues/55