Last active
July 26, 2017 17:21
-
-
Save matthieu-D/ea3159ba021c8087393483d60d825a62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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