3

I'm working on a project that involves a native iOS client as well as a web back end (a Padrino app, if it matters). I've got Facebook authentication working fine for either one individually; but what I would like if at all possible is for the user to login using the native app using Facebook's iOS SDK, and then for this authentication to somehow make it all the way to my servers. The alternative seems to be to require the user to log in twice with Facebook, which I'm sure can't be right.

Is this possible? Alternately, what is the standard way to solve this problem?

2
  • Why would the back-end want to do anything with the user's Facebook account? Commented Jun 12, 2012 at 3:05
  • @nhahtdh: Sorry, the question might have been a bit misleading. I want to share authentication, but I am not just using Facebook for auth. The whole application is based around the Facebook graph API; so most of the logic involving users' friends, profiles, etc. will exist on the back end. Unless, of course, what I'm asking isn't possible. Commented Jun 12, 2012 at 3:09

1 Answer 1

4

I've done this before, and it wasn't a problem. Once you obtain the proper tokens in your iOS client, you should be able to share those with your server to allow it to perform the same requests. Just be careful about how you send those sensitive tokens to your server!

Sign up to request clarification or add additional context in comments.

3 Comments

Nice, I was hoping someone else had success with this. I just need to dig in a little and figure out which token(s) I need to share. As for your warning: is sending the tokens via HTTPS good enough, you think? Or were you implying something else?
It's my understanding that sending this over HTTPS should be fine. See here: stackoverflow.com/questions/1582894/…
Finally got around to testing this (well, several days back) and it worked like a charm. Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.