Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

api authentication in rails 3

Currently I have an rails 3 application which uses devise plugin for website authentication. But now I'll be adding an iPhone app as well so I will be exposing the api calls to the client device (iPhone). How would I implement auth module so that iPhone client can authenticate to the rails site and access some api?

Should I be creating a oauth provider, token base auth or simple http auth works?

like image 555
ed1t Avatar asked Mar 19 '11 13:03

ed1t


1 Answers

In this situation, HTTP Basic authentication would work fine. If you'd like it to be more secure, you could create an OAuth provider and create your own implementation of Twitter xAuth to make it more user friendly. Essentially, you'd create an API call that would accept a username and password and then return an OAuth request token for that user. You'd store that request token on the iPhone and use it to authenticate subsequent requests.

like image 56
Charlie Melbye Avatar answered Oct 15 '22 08:10

Charlie Melbye