简体   繁体   中英

Using OAuth as Rails webapp API authentication?

I'm attempting to build up an API around a fairly simple concept: a User has many Location s. The locations have CRUD operations exposed via JSON and XML. There is no HTML view to this web service.

There is a completely separate website that will use my API via JavaScript and AJAX calls (in addition to mobile clients on smartphones) to manipulate a user's locations. I'd love to use two-legged OAuth to expose the user's locations as a Provider for authentication.

Are there any Rails plugins that would make this fairly easy (OAuth + authlogic don't seem to implement two-legged OAuth or even a Provider) or do I need to implement it myself?

Here's a link, about a year old, should get you in the right direction:

http://stakeventures.com/articles/2007/11/26/how-to-turn-your-rails-site-into-an-oauth-provider

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM