Skip to content

How to use enable Google One-Tap Sign In #8184

Open
@Jun711

Description

@Jun711

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I am aware of federated sign in.

However, I would like to enable Google sign-in new feature that is not supported by federatedSignIn call, this document suggests to use the following code.
Since I am already using Amplify for authentication, I would like to continue using it.

However the following code would not work with [email protected]. How should I proceed?

AWS.credentials and AWS.config don’t exist anymore anywhere in Amplify JavaScript. 
Both options will not be available to use in version 3. You will not be able to use and set your own credentials.
function signinCallback(authResult) {
  if (authResult['status']['signed_in']) {

     // Add the Google access token to the Amazon Cognito credentials login map.
     AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: 'IDENTITY_POOL_ID',
        Logins: {
           'accounts.google.com': authResult['id_token']
        }
     });

     // Obtain AWS credentials
     AWS.config.credentials.get(function(){
        // Access AWS resources here.
     });
  }
}

Describe the solution you'd like
Enable using and setting our own credentials.

Metadata

Metadata

Assignees

No one assigned

    Labels

    AuthRelated to Auth components/categoryCognitoRelated to cognito issuesFederationUsed for federation related issuesService TeamIssues asked to the Service Teamfeature-requestRequest a new featurepending-maintainer-responseIssue is pending a response from the Amplify team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions