Requesting AWS Credentials

Now that we’ve successfully connected our app with Google through the Sign-In process, we can use the identity token to create a Cognito identity. To do that, we’re going to use the AWS SDK for JavaScript to create and configure a CognitoIdentityCredentials object. This object will allow our app to get AWS credentials that it can use to directly access Amazon’s web services as an authenticated user. The AWS SDK is already included in the vendor.js file in the prepared workspace.


If you add other identity providers to this app, you’ll need to follow a similar process for each of them.

To create the CognitoIdentityCredentials ...

Get Serverless Single Page Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.