Skip to content

sebolabs/cognito-idp-tst

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

cognito-idp-tst

Story

Cognito Federated Identities with Google IdP — the simplest try-yourself tutorial

Configuration

index.html

<meta name="google-signin-client_id" content="XXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com">

scripts.js

function signInCallback(authResult) {
  if (authResult['access_token']) {
    
    // add google access token to Cognito credentials login map
    AWS.config.region = 'XX-XXXX-X';
    AWS.config.credentials = new AWS.CognitoIdentityCredentials({
      IdentityPoolId: 'XX-XXXX-X:XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
      Logins: {
        'accounts.google.com': authResult['id_token']
      }
    });
[...]

About

Cognito Federated Identities with Google IdP — the simplest try-yourself tutorial

Topics

Resources

Stars

Watchers

Forks