React Native - Apple Sign In
See original GitHub issueI followed the doc to add Sign in with Google, Facebook and Apple from here: https://docs.amplify.aws/lib/auth/social/q/platform/js
Google and Facebook work perfectly fine but I couldn’t make Apple work after a whole day debugging.
Here’s some screenshots of the flow:
Here’s my logs from the Hub
[Mon Aug 24 2020 17:20:03.980] LOG Hub.auth {"payload": {"data": {"url": "setmatch://?error_description=SignInWithApple+Error+-+400+invalid_client&state=wrBob3s5zqoty4YDYInEC9NL5wQnQNuK&error=invalid_request"}, "event": "parsingCallbackUrl", "message": "The callback url is being parsed"}}
[Mon Aug 24 2020 17:20:03.981] ERROR [ERROR] 20:03.971 OAuth - Error handling auth response. [Error: SignInWithApple+Error+-+400+invalid_client]
[Mon Aug 24 2020 17:20:04.700] LOG Hub.auth {"payload": {"data": [Error: SignInWithApple+Error+-+400+invalid_client], "event": "signIn_failure", "message": "The OAuth response flow failed"}}
[Mon Aug 24 2020 17:20:04.900] LOG signIn_failure
[Mon Aug 24 2020 17:20:04.100] LOG Hub.auth {"payload": {"data": [Error: SignInWithApple+Error+-+400+invalid_client], "event": "cognitoHostedUI_failure", "message": "A failure occurred when returning to the Cognito Hosted UI"}}
[Mon Aug 24 2020 17:20:04.110] LOG Hub.auth {"payload": {"data": [Error: SignInWithApple+Error+-+400+invalid_client], "event": "customState_failure", "message": "A failure occurred when returning state"}}
aws-exports.js
const awsmobile = {
"aws_project_region": "us-east-1",
"aws_cognito_identity_pool_id": "us-east-1:xxxxxx,
"aws_cognito_region": "us-east-1",
"aws_user_pools_id": "us-east-1_xxxxxxx",
"aws_user_pools_web_client_id": "xxxxxx",
"oauth": {
"domain": "setmatch-dev.auth.us-east-1.amazoncognito.com",
"scope": [
"phone",
"email",
"openid",
"profile",
"aws.cognito.signin.user.admin"
],
"redirectSignIn": "setmatch://",
"redirectSignOut": "setmatch://",
"responseType": "code"
},
"federationTarget": "COGNITO_USER_POOLS",
"aws_appsync_graphqlEndpoint": "https://xxxxxx.appsync-api.us-east-1.amazonaws.com/graphql",
"aws_appsync_region": "us-east-1",
"aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
"aws_appsync_apiKey": "xxxxxx",
"aws_user_files_s3_bucket": "xxxxxx",
"aws_user_files_s3_bucket_region": "us-east-1",
"aws_mobile_analytics_app_id": "xxxxxx",
"aws_mobile_analytics_app_region": "us-east-1"
};
Here’s some Cognito screenshots
Here’s some Apple screenshots
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:9 (2 by maintainers)
Top Results From Across the Web
GitHub - invertase/react-native-apple-authentication
A well typed React Native library providing support for Apple Authentication on iOS and Android, including support for all AppleButton variants.
Read more >React Native: Sign in with Apple - Ross Bulat - Medium
Go to your Keys list and add a new key for Sign in with Apple. Add your (Primary) App ID to the key...
Read more >How to add Apple authentication to your React Native app
Install the required npm packages from the terminal. · Run the command to install pods in your project in the terminal. · In...
Read more >react-native-apple-authentication - npm
react -native native module for Apple Login. Latest version: 2.0.0, last published: 2 years ago.
Read more >How to “Sign in with Apple” on React Native - Level Up Coding
Give it a name; Check “Sign in with Apple”; Configure “Sign in with Apple”, select your App ID; Register the key; Download it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Alright. After another afternoon debugging this with the amazing help of @amhinson, I finally made it working. It basically was something like this: Here’s the steps I did (not sure which one helped):
invalid_client
errorin my experience since apple is making mandatory using “sign in with apple” in your project like a mobile app if you use other socials like Facebook or google, nothings seems to solve the issue that amplify with cognito using federatedSignIn with apple sign in does not work at all! I have spent days testing everything and still not having any solution! Please amplify put a clear working sample of using federatedSignIn with signInwithApple because it seems it is not working and only Facebook and google socials works fine! thanks