Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails Devise OmniAuth Facebook Login from iOS

Tags:

I've been searching for a solid solution to this problem, and came across this SO question which kind of matches my predicament, but not exactly.

Currently I have my iPhone application authenticating with my Rails API via Basic Auth. It's just your simple, run-of-the-mill devise auth package. I then followed the instructions to set up omniauth-facebook for devise and got that working on the browser side.

The part I can't figure out how to do is how to send the token received on the iPhone side (via the Facebook iOS SDK) to the server. I want the server to check the users table to see if that facebook user has signed up, and create an account for him if he hasn't. Then, I was thinking the server would generate a random password and send it back to the client device so that I could keep my same basic authentication strategy. Is this the proper way to implement single sign on for a web app and iPhone app? How would one go about modifying the server side packages to support authentication via a token sent from the phone?

like image 766
Andrew K Avatar asked Mar 26 '14 14:03

Andrew K


1 Answers

You may want to take a look here:

Open Source: Announcing devise-iOS For Simplified Auth

It looks like a relatively painless way to work with Rails / Devise and iOS. I definitely plan on using it in my next project.

like image 133
damianesteban Avatar answered Oct 12 '22 23:10

damianesteban