Digest authentication in development

I use Rails 3 and Devify for authentication. I have the proper working device for the website and basic authentication for the API (json handler). How to enable digest check?

Their wiki tells me to add

def http_authenticate
  authenticate_or_request_with_http_digest do |user_name, password|
    user_name == "foo" && password == "bar"
  end
  warden.custom_failure! if performed?
end

Where can I add it and how to make a username / password match?

+5
source share
1 answer

This wiki entry necessarily involves a lot.

My best guess: you need to add it to the appropriate controller (or application controller if you want it for everything).

: before_filter: http_authenticate! , .

. , Warden . - .

, , - (, OmniAuth) - /, . DeclarativeAuthorization CanCan, - .

HTTPBasic ( , ) .

+1

All Articles