Skip to content
This repository has been archived by the owner on Jul 18, 2020. It is now read-only.

Cannot get native Facebook login to work #8

Closed
klatchbaldar opened this issue Dec 12, 2015 · 8 comments
Closed

Cannot get native Facebook login to work #8

klatchbaldar opened this issue Dec 12, 2015 · 8 comments

Comments

@klatchbaldar
Copy link

I have followed all the Quick Start guides and I can get the native iOS Auth0 to work with the native Facebook login but not with React.

@keeth
Copy link
Contributor

keeth commented Dec 24, 2015

@klatchbaldar are you trying this in iOS 9? Starting with 9.0 the default FBSDK behavior is to log in with Safari / WebView.

https://github.com/facebook/facebook-ios-sdk/blob/master/FBSDKCoreKit/FBSDKCoreKit/Internal/ServerConfiguration/FBSDKServerConfigurationManager.m#L226

@klatchbaldar
Copy link
Author

Yes, 9.X but the flow with Facebook using the react library is different than the flow using the iOS example. It seems like a web view that is not Safari is initiated and the FB cookies are not present so it forces the user to enter all FB credentials again (not desirable).

@keeth
Copy link
Contributor

keeth commented Dec 24, 2015

Do you have WebKit.framework under 'Linked Frameworks and Libraries'?

@klatchbaldar
Copy link
Author

I added it but it didn't seem to make a difference. Any other suggestions?

On Thu, Dec 24, 2015 at 2:02 PM, Keith Grennan notifications@github.com
wrote:

Do you have WebKit.framework under 'Linked Frameworks and Libraries'?


Reply to this email directly or view it on GitHub
#8 (comment)
.

@klatchbaldar
Copy link
Author

Turning on [A0LockLogger logAll] gets:

-- Authenticating with connection facebook
-- Authenticating facebook with WebView authenticator

@keeth
Copy link
Contributor

keeth commented Dec 25, 2015

set a breakpoint in A0WebViewAuthenticator.authenticateWithParameters and see which controller is returned by newWebControllerWithParameters - either A0WebKitViewController or A0WebViewController.. not sure if that's the issue but prolly good to verify if the webkit controller is being picked or not

@keeth
Copy link
Contributor

keeth commented Dec 25, 2015

I think I just figured this out...

You need to add the integrations key when you call the Lock constructor. This will cause the Lock-Facebook integration to be used (make sure it is part of your project), which in turn uses FBSDKLoginKit to do the auth with SafariViewController if available.

var lock = new Auth0Lock({
      clientId: Config.get('auth0ClientId'),
      domain: Config.get('auth0Endpoint'),
      integrations: {
        facebook: {
          permissions: ['public_profile']
        }
      }});

@klatchbaldar
Copy link
Author

Amazing! Working now. Many thanks I would have never thought that was the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants