I am developing a simple api which will be used by iphone. Is there a simple authentication gem (with token authentication or api key) in rails which I can use over http(No https). Some thing like Devise with token_authentication enabled.
you can simply add http basic auth support by adding following to application controller
before_filter :http_basic_authenticate
def http_basic_authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "1username" && password == "password1"
end
end
then try
curl http://yourdomain.com
=> HTTP Basic: Access denied.
curl --user 1username:password1 http://yourdomain.com
=> result .....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With