Facebook iOS SDK and passport-facebook authentication
Asked Answered
V

1

15

I'm trying to implement server facebook authentication using passport-facebook on an iOS Facebook SDK app, and I'm unclear how to setup the passport authentication on the backend.

Basically the iOS client authenticates with Facebook and gets the sessionToken and I want to pass that to the passport-facebook /auth/facebook/callback to verify the session token with FB, and lookup the user from our database through node.js.

Is that the correct way to use passport-facebook, or do I need call /auth/facebook (and what parameters do I need to pass it).

This issue mentions building an app using Facebook iOS SDK and then authenticating on the server, but doesn't mention exactly how to do that.

https://github.com/jaredhanson/passport-facebook/issues/7

I could also write my own custom passport strategy that simply passes the FB session token and I can verify with FB graph API on the server to get the FB user ID and authenticate it's a valid session, as mentioned here: Design for Facebook authentication in an iOS app that also accesses a secured web service

Vino answered 23/8, 2013 at 15:18 Comment(0)
S
22

Check out passport-facebook-token, which is designed to authenticate based on a previously issued token (ie, the one issued to your iOS app).

passport-facebook is designed to do the web-based, redirect flow, which is not typically done from a mobile application.

Skeet answered 23/8, 2013 at 18:55 Comment(1)
is there anyway we can make it work with passport-facebookGaspard

© 2022 - 2024 — McMap. All rights reserved.