method
http_basic_authenticate_with
v4.2.9 -
Show latest stable
- Class:
ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods
http_basic_authenticate_with(options = {})public
No documentation available.
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 69
def http_basic_authenticate_with(options = {})
before_action(options.except(:name, :password, :realm)) do
authenticate_or_request_with_http_basic(options[:realm] || "Application") do |name, password|
# This comparison uses & so that it doesn't short circuit and
# uses `variable_size_secure_compare` so that length information
# isn't leaked.
ActiveSupport::SecurityUtils.variable_size_secure_compare(name, options[:name]) &
ActiveSupport::SecurityUtils.variable_size_secure_compare(password, options[:password])
end
end
end