Auth0 Home Blog Docs

Facebook login using Auth0 API best practice

api
social-connection
auth0-api
facebook-login

#1

I’m having trouble getting my users authenticated using facebook login and Auth0 API.
I’m using the login social Auth0 API and an SFSafariViewController to get the user to be redirected to the Facebook’s sign in page.
It works, but the behavior is a bit strange, since the webview is always asking me to enter my username and password on the Facebook’s sign in page, as if it would not remember me (or as if I would be on a private navigation session).
I tried to change the SFSafariViewController to an SFAuthenticationSession, which is way better since now it remembers me (and I don’t have to enter my Facebook username and password each time I try to login) but now, I have a consent dialog box which is kind of ugly for my user.
My question is, where do I do wrong ? What would be the best practice to implement this Facebook login so that it remembers me (and the fact that I already logged in) ? :slight_smile:


#2

Based on my limited knowledge about iOS you’re not doing anything wrong and going forward the way to have any notion of remembering previously used credentials is indeed to use SFAuthenticationSession, however, the consent alert showing every time seems to be inherent to that and non-configurable. Based on some reports found online you’re not alone in terms of complaining about that and I would suggest you to do the same that is suggested at (https://stackoverflow.com/questions/46414099/create-sso-using-sfauthenticationsession-in-ios-11); raise an issue with Apple so that they consider at least showing the consent only once per application.


#3

Hey jmangelo,

Thanks for getting back to me. Actually, my problem is also that this consent tells the user that my app is using Auth0.com to authentify him, while he has just pushed the “Facebook Connect” button. It can be a bit tricky for the user, and he might not understand that.
That’s why I’m looking for something else :slight_smile:
Anyway, I’ll raise the issue so that Apple may consider not showing that consent everytime the user login, at least.
But if anyone else has a suggestion on how I could do better with that problematic, I’d be very thankful :slight_smile:


#4