New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
showSignIn() POP-UP even though AWSMobileClient.default.isSignedIn = true #2357
Comments
Hi AWS iOS team, |
Hi @Nicolaidam. Thank you for reporting this issue. That video was very useful to replicate the exact setting. Thanks for that. Brief summary: I need little more information from you. Can you check the OAuth scopes in awsconfiguration.json file and also in the HostedUIOptions that you set in showSignIn function and see if they match? |
Hi @phani-srikar |
Hi @Nicolaidam |
Okay thanks. Can you please explain what the different scopes do? Are they only related to the UI-login? As standard i had: "phone", "email", "openid", "profile", "aws.cognito.signin.user.admin" |
Hi @Nicolaidam |
Cool Thanks a lot @phani-srikar. Is it a possibility with showSignIn to get the users firstName, like you can with the original Facebook Developer API? |
You can get more user attributes using the user attribute api. If you are using a social provider, you need to map the attributes - https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-attribute-mapping.html |
I've had luck with mapping attributes for email, first name and ID from Facebook. However I'm not able to get gender/birth. Is that maybe because the "profile" scope only gets a bit information from Facebook? |
Describe the bug
A clear and concise description of what the bug is.
I'm using Appsync Graphql API with Cognito Userpool and showSignIn() method for login with Facebook. The user gets in to Userpool as expected and from here I can read/write to Graphql API. After closing the app and opening it again the user is still logged in as expected, however I get a Facebook-Login POP UP ".. wants to use.." even though I'm already logged in. (AWSMobileClient.default.isSignedIn = true) The problem only occurs with showSignIn() method using Facebook, it works as it should with the Cognito method signIn(), also after restarting the app and trying to make a mutation after that.
To Reproduce
Steps to reproduce the behavior:
Which AWS service(s) are affected?
Amplify
Cognito
Appsync
Expected behavior
A clear and concise description of what you expected to happen.
I would expect that I can read/write with Appsync Graphql API when AWSMobileClient.default.isSignedIn = trueWITHOUT getting "..wants to use.."-POP-UP, also after closing the app and opening it again, since I'm suing Userpool as authentication. Therefore it is expected there is no POP-UP when communicating with Graphql API as long as I'm already logged in.
Screenshots
If applicable, add screenshots to help explain your problem.
I've made a video showing the problem.
0.13: I login with Facebook. Using showSignIn method.
0.13 - 0.38: I show how I print logged in status out in the terminal using a button "Print user info" After logging signedIn = true.
0.38 - 0.44: I show that I write to the AppSync GraphQL API using the "Opret barn"-button. (I'll show this method later)
0.44 - 0.59: I restart the app and show signedIn = true.
0.59 - 1.23: I show that I'm NOT able to write to the AppSync GraphQL API using the "Opret barn"-button without clicking the pop up.
1.23 - 1.47: I show the code getting executed after clicking "opret barn" button. (Writing to database)
1.58 - 2.22: I show initialization of AppSync GraphQL API in AppDelegate
2.22 - 2.38: I show how I go to main page if the user is already logged in. Else it should go to login screen.
LINK: https://drive.google.com/file/d/1HR6iba--yFdOffml6_TRCmLmBBEQ2BvY/view?usp=sharing
Environment(please complete the following information):
pod 'AWSMobileClient', '
> 2.12.0'> 2.15.0'pod 'AWSAppSync', '
Device Information (please complete the following information):
Additional context
I have used this Blog-post as guide for my project:
https://amplify-ios-workshop.go-aws.com/
The text was updated successfully, but these errors were encountered: