Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Last active July 26, 2017 17:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/ea3159ba021c8087393483d60d825a62 to your computer and use it in GitHub Desktop.
Save matthieu-D/ea3159ba021c8087393483d60d825a62 to your computer and use it in GitHub Desktop.
makeGoogleCredentials(idToken, username) {
AWSCognito.config.credentials = new AWS.CognitoIdentityCredentials({
IdentityPoolId: aws_cognito_identity_pool_id,
Logins: {
'accounts.google.com': idToken
}
});
// Obtain AWS credentials
AWSCognito.config.credentials.get((error) => {
// Access AWS resources here.
console.log('We are in', error);
if (!error) {
const user = this.makeUser(username);
console.log(user);
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment