Ruby ways to authenticate using headers?

Posted by webdestroya on Stack Overflow See other posts from Stack Overflow or by webdestroya
Published on 2010-05-22T22:03:22Z Indexed on 2010/05/22 22:20 UTC
Read the original article Hit count: 279

I am designing an API system in Ruby-on-Rails, and I want to be able to log queries and authenticate users.

However, I do not have a traditional login system, I want to use an APIkey and a signature that users can submit in the HTTP headers in the request. (Similar to how Amazon's services work)

Instead of requesting /users/12345/photos/create I want to be able to request /photos/create and submit a header that says X-APIKey: 12345 and then validate the request with a signature.

Are there any gems that can be adapted to do that? Or better yet, any gems that do this without adaptation?

Or do you feel that it would be wiser to just have them send the API key in each request using the POST/GET vars?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby