Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a session in iOS native app, using Facebook OAuth and Rails Devise gem?

We have a web app running on Rails, using Devise and OmniAuth for user authentication.

We are now building a iOS native app for the web app. We don't really know what's the best practice to implement this.

We will create a button for user login with facebook, when users click on it, they will be redirected to Facebook native app for authentication.

Controllers in Rails are secure by Devise. If the iOS app want to talk with the web app, the iOS itself are required to create a session which can communicate with Devise

The Facebook native app only return a Facebook access token. We can't use this token to create a Devise session.

So.....

  1. How can we create a Devise session with this combination?
  2. Is there any better solution for this purpose?

Thank all.

like image 978
Victor Lam Avatar asked Mar 08 '12 10:03

Victor Lam


1 Answers

Check out the following post:

http://matteomelani.wordpress.com/tag/rails/

like image 85
Karan Avatar answered Oct 07 '22 00:10

Karan