O'Reilly logo

Serverless Single Page Apps by Ben Rady

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

images/aside-icons/tip.png

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required