question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CognitoIdentityCredentials params Logins key for sign In with Apple ID?

See original GitHub issue

Confirm by changing [ ] to [x] below:

Describe the question

What value should be used for the Logins property of the parameters required to intialize the Cognito Credentials object (CognitoIdentityCredentials) if I need to support social login for Apple ID.

AWS documentation only lists the below keys

  • Facebook: graph.facebook.com
  • Google: accounts.google.com
  • Amazon: www.amazon.com
  • Twitter: api.twitter.com
  • Digits: www.digits.com

See https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_CreateIdentityPool.html#API_CreateIdentityPool and https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentity.html

I can’t find what should be used for Apple ID anywhere in the AWS documentation and the aws-sdk typescript does not list it as well - see below

    /**
     * A set of optional name-value pairs that map provider names to provider tokens. The available provider names for Logins are as follows:   Facebook: graph.facebook.com    Amazon Cognito user pool: cognito-idp.<region>.amazonaws.com/<YOUR_USER_POOL_ID>, for example, cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789.    Google: accounts.google.com    Amazon: www.amazon.com    Twitter: api.twitter.com    Digits: www.digits.com   
     */
    Logins?: LoginsMap;

My code as below (see WHAT SHOULD BE INSERTED HERE TO SUPPORT APPLE ID SOCIAL LOGIN placeholder)

        // The parameters required to intialize the Cognito Credentials object.
        const params = {
          AccountId: awsConfig.AWS_ACCOUNT_ID,
          RoleArn: awsConfig.IAM_ROLE_ARN,
          IdentityPoolId: awsConfig.COGNITO_IDENTITY_POOL_ID,
          Logins: { }
        };

        params.Logins[<WHAT SHOULD BE INSERTED HERE TO SUPPORT APPLE ID SOCIAL LOGIN>] = accessToken;
        // set the Amazon Cognito region
        AWS.config.region = awsConfig.AWS_REGION;
        // initialize the Credentials object with our parameters
        AWS.config.credentials = new AWS.CognitoIdentityCredentials(params);

        (AWS.config.credentials as AWS.CognitoIdentityCredentials).get((err: AWSError) => {
          if (err) {
            reject(err);
          }
          else {
            const COGNITO_IDENTITY_ID = (AWS.config.credentials as AWS.CognitoIdentityCredentials).identityId;
            awsConfig.COGNITO_IDENTITY_ID = COGNITO_IDENTITY_ID;
            this.share.cognitoIdentityId = COGNITO_IDENTITY_ID;
            resolve();
          }
        });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
bgrynblatcommented, Jan 22, 2020

I am facing the same issue, any chance this could be implemented since Sign in Apple is available on Cognito ? Thanks 🙏🙏🙏

2reactions
ryaacommented, Jan 15, 2020

@ajredniwja Any estimate when the appropriate key will be supported for Login Provider?

Read more comments on GitHub >

github_iconTop Results From Across the Web

CognitoIdentityCredentials params Logins key for sign In with ...
You need create Apple provider in OpenID or SAML provider if Apple support them. This is example for config Auth0 as OpenID provider...
Read more >
Getting credentials - Amazon Cognito - AWS Documentation
CognitoIdentityCredentials constructor without the roles as parameters. To do so, open the Amazon Cognito console , choose Manage identity pools, select ...
Read more >
Open ID Connect providers (identity pools) - Amazon Cognito
The iss parameter must match the key that the logins map uses (such as login.provider.com). · The signature must be valid. · The...
Read more >
Java Integration with Amazon Cognito Developer Tutorial
Amazon Cognito is a simple user identity and data synchronization service that ... With Temporary Password: This parameter is not required, ...
Read more >
Class: AWS.CognitoIdentityCredentials - API Manual
If the identity or identity pool is not configured in the Amazon Cognito Console to use ... used for authenticated login // See...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found