uomolupo
uomolupo

Reputation: 77

NodeJS, Facebook API, Xcode

I am trying to create an ios App that talks to a backend API written in nodejs. The backend also has an accompanying webapp also written in nodejs. The idea is that you can login (using facebook-js) on either the app or the webapp and post things to to.

My question is this, let's say that the user decided to login using the ios App, then call some backend API method to post an article, how do I make this work without essentially forcing the user to login twice?

Not sure if I'm making sense, any help would be greatly appreciated!

Upvotes: 1

Views: 328

Answers (1)

Tobi
Tobi

Reputation: 31479

As Facebook uses OAuth for the client authentication, it's relatively easy to store the Access Token resulting from the login process somewhere on your server, and use them later.

Have a look at Design for Facebook authentication in an iOS app that also accesses a secured web service

Also, see https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.1 which outlines the login process and the storage of Access Tokens.

Upvotes: 1

Related Questions