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.

Apple Signing Token is not from a supported provider of this identity pool.

See original GitHub issue

Describe the bug I can’t signing with federated using https://github.com/invertase/react-native-apple-authentication In the provider I tested with SignInWithApple or appleid.apple.com

Code Snippet await Auth.federatedSignIn(‘appleid.apple.com’, {token: data.identityToken, expires_at: null})

Screenshots If applicable, add screenshots to help explain your problem.

What is Configured? If applicable, please provide what is configured for Amplify CLI:

Auth: {
 	identityPoolId: 'us-east-1:59cf7619-1bf8-4dc0-xxxx-xxx',
 	region: 'us-east-1',
 	storage: MemoryStorageNew,
 	userPoolId: 'us-east-1_xxxx,
 	userPoolWebClientId: ''
 }
 

Smartphone (please complete the following information):

  • Device: iPhone11
  • OS: 13.4

Additional context Add any other context about the problem here.

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:47 (19 by maintainers)

github_iconTop GitHub Comments

5reactions
amhinsoncommented, May 6, 2020

@mezalejandro After looking a bit further, there seem to be 2 options for you to integrate “Sign In With Apple” in your app.


The first is using the OAuth Hosted UI, where the user will be taken to a browser to authenticate. In this case, you don’t need to use that 3rd party library to get the Apple token, as Cognito will handle that behind the scenes. In this case, you can just use Auth.federatedSignIn({provider: 'SignInWithApple'}).


The other option is using Identity Pool Federation, where you will have to manage all of the tokens via the client & the 3rd party library you’re currently using.

There are some intricacies with this approach, however. Here’s how I got a working example:

  • Add your app bundle id in the “Apple Services ID” field for the Identity Pool: Cognito -> Manage Identity Pools -> (select identity pool) -> Edit identity pool -> Authentication Providers -> Apple
import appleAuth, {
  AppleButton,
  AppleAuthRequestOperation,
  AppleAuthRequestScope,
} from '@invertase/react-native-apple-authentication';

//

async function onAppleButtonPress() {
    const result = await appleAuth.performRequest({
      requestedOperation: AppleAuthRequestOperation.LOGIN,
      requestedScopes: [
        AppleAuthRequestScope.EMAIL,
        AppleAuthRequestScope.FULL_NAME,
      ],
    });
    const decoded = jwt_decode(result.identityToken);

    const credentials = await Auth.federatedSignIn(
      'appleid.apple.com',
      {
        token: result.identityToken,
        expires_at: decoded.exp * 1000 + new Date().getTime(),
      },
      {
        name: `${result.fullName.givenName} ${result.fullName.familyName}`,
        email: decoded.email,
      },
    );

    console.log(credentials);
  }

//

<AppleButton
    buttonStyle={AppleButton.Style.WHITE}
    buttonType={AppleButton.Type.SIGN_IN}
    style={{
        width: 160,
         height: 45,
    }}
    onPress={() => onAppleButtonPress()}
/>
1reaction
amhinsoncommented, May 11, 2020

@TanviVartak Ah ok! I’ll look into it and respond in that other issue, as the original issue here is a slightly different use-case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cognito Login With Amazon "Token is not from a supported ...
" NotAuthorizedException: Token is not from a supported provider of this identity pool." This issue usually occurs if the app client used for...
Read more >
Using DynamoDB With Cognito: Token is not from a supported ...
That exception is usually thrown if you've given Cognito a login but have not enabled your identity pool to consume that login provider....
Read more >
Sign in with Apple (identity pools) - Amazon Cognito
Amazon Cognito integrates with Sign in with Apple to provide federated authentication for your mobile application and web application users.
Read more >
Amazon Web Services (Aws) Cognito Error "Token Is Not ...
0<wbr>), которая говорит: "Token is not from a supported provider of this identity pool. Sign In With Apple not working with Xcode 12...
Read more >
Identity pools (federated identities) authentication flow
The identity ID is then used with the same identity provider token in a ... Additionally, if your identity pool does not have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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