amplify-js: Auth.federatedSignIn returns undefined cred while signin with apple

Describe the bug I use cognito user pool + federeted identity to create unique identities for your users and to securely access other AWS services. I am trying to implement sign in with apple along with normal signin. Normal sign in takes email as username. After following steps mentioned here -https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html , user gets created in cognito user pool but Auth.currentAuthenticatedUser() returns unauthenticated user error. Also cred is undefined.

Auth.federatedSignIn({ provider: "SignInWithApple", }).then(cred => { // If success, you will get the AWS credentials console.warn("success is",cred); return Auth.currentAuthenticatedUser(); })

To Reproduce Steps to reproduce the behavior:

follow these steps https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-social-idp.html

Expected behavior User should get created in user pool as well as federated identity should get created. Auth.federatedSignIn should return valid credentials Auth.currentAuthenticatedUser() should return valid apple user

Code Snippet Please provide a code snippet or a link to sample code of the issue you are experiencing to help us reproduce the issue. (Be sure to remove any sensitive data)

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

What is Configured?

  • If applicable, please provide your manual configuration example:
 Amplify.configure({
Auth: {
 mandatorySignIn: true,
 region: config.cognito.REGION,
 userPoolId: config.cognito.USER_POOL_ID,
 identityPoolId: config.cognito.IDENTITY_POOL_ID,
 userPoolWebClientId: config.cognito.APP_CLIENT_ID,
 oauth : {
   domain : 'cognito domain name',
   scope : ['phone', 'email', 'profile', 'openid','aws.cognito.signin.user.admin'],
   redirectSignIn: 'myapp://oauth/',
   redirectSignOut: 'myapp://signout/',
   responseType: 'code'
 },
}
})
npx envinfo --system --binaries --browsers --npmPackages --npmGlobalPackages

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

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.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 6
  • Comments: 21 (9 by maintainers)

Most upvoted comments

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sorry about that @irshadnilam . Re-opening. Flagging to @sammartinez to prioritize

This stale bot sure is annoying. Every issue i come across is closed by this damn bot without any resolution whatsoever.