Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating an iPhone app with web backend

I'm just fleshing out some ideas for an iphone web app and it's going to be (in essence) a CRUD interface to a Rails web backend. Ultimately that backend will be a full blown website too.

My question is: what's the best way to handle "logging in" on the iPhone app? How should it authenticate to allow the user to see their data and add new stuff?

For Rails I generally use Authlogic, so it'd be nice if I could keep doing that.

like image 787
Colin Ramsay Avatar asked Dec 18 '22 03:12

Colin Ramsay


2 Answers

Check out this sample app available on GitHub. It has both the iPhone and Rails implementation and uses keychains on the iPhone side while RESTfully connecting using JSON/XML to the Rails server.

You can use whatever authentication solution you want on the Rails side as long as it has an interface that's available to the iPhone app. This app uses Ryan Bates' simpler nifty_authentication for authentication.

like image 172
bensie Avatar answered Jan 06 '23 21:01

bensie


Have you think about using Authlogic's single access token option for this. I'm working on a app exactly same as yours. (yet this API call part is not implemented fully) but have a look in to the authlogic example on github.

like image 45
randika Avatar answered Jan 06 '23 23:01

randika