That’s awesome. It would be great if you can share it with us and we’ll post a link to it for everybody else.
That line is basically a callback that a parent component can use once the login is completed. In our case we simply flag the app state as the user has logged in.
Hi Jay!
Thank you for your great effort! I’ve successfully implemented the Facebook button.
However, once I’m logged in and hit the ‘refresh’ button in the browser I get a blank screen which can only removed after
Deleting all Browser Data
Logging in again.
Do you have any idea what could cause this issue?
Cheers,
Mario
Awesome, thank you for this chapter! It would be very helpful to see a Google example, as the AWS Amplify documentation on this is horrible. Much appreciated!
First of all, thanks for this awesome guide. It is a super helpful and saved me a lot of time. Second, I have a question - I need to make sure I get the overall pattern right.
Assuming I am writing a web serverless app with both “local” users (stored & authorized by a Cognito User Pool), and facebook users, the overall structure is like this:
New local users register by Auth.signUp
Existing local users login by Auth.signIn
Facebook users register/login (is the same for them) by Auth.federatedSignIn. Arguments for this function (token & user attributes) are received from FB by the login and me apis.
Is this correct? What is confusing me a little bit is that with this setup, the Auth.currentAuthenticatedUser function can return two completely different things: either a CognitoUser object for local users or just a plain map of user attributes and I have found no official, documented way of distinguishing these two case. Of course, I can remember what auth method user used or I can check the class of the returned value (or presence of some keys, whatever), but that feels a bit odd. So, is the above pattern correct? Or am I missing something?
I am working on setting up Facebook login, but I keep getting these errors: “The method FB.login can no longer be called from http pages.” and “The method FB.getLoginStatus can no longer be called from http pages.” Basically, https://localhost:3000 would work, but http://localhost:3000 does not, and I am using the latter.
This is weird because Facebook’s documentation says http://localhost:3000 should work as long as you’re in development mode and using a test user (which I am). Has anyone run into this issue before and know how to solve it? Thank you!!
So it turned out the http/https thing was throwing errors in the console but was not actually a problem in carrying out the FB login. The FB login wasn’t working for me, but for a different reason. I had to move some code around, and now it works. I think it wasn’t getting the updated status after login. I am using the following code:
Thanks for the chapter and active replying! How much difference it is between using User Pool and Identity Pool from UI code point view? Do you have a sample?
No for not being clear. The User Pool itself has “Federation->Identity Provider”, firstly I want to understand how it’s different with using Federation in Identity Pool from programming point view?
Secondly, from users perspective, are the login flows different between Federation in User pool and Federation in Identity Pool?
Does the Identity Pool support Apple sign-in, or is that only supported through the User Pool? Also, what are the pros and cons of the User Pool not being involved in the case of using the Identity Pool for 3rd party sign-up/sign-in?
Finally, it would be great to this chapter the CloudFormation configuration part.