instance method
http_basic_authenticate_with
Ruby on Rails edge
Since v3.1.12Signature
http_basic_authenticate_with(name:, password:, realm: nil, message: nil, content_type: nil, **options)
Enables HTTP Basic authentication.
See ActionController::HttpAuthentication::Basic for example usage.
Parameters
-
namekeyreq -
passwordkeyreq -
realmkey = nil -
messagekey = nil -
content_typekey = nil -
optionskeyrest
Source
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 79
def http_basic_authenticate_with(name:, password:, realm: nil, message: nil, content_type: nil, **options)
raise ArgumentError, "Expected name: to be a String, got #{name.class}" unless name.is_a?(String)
raise ArgumentError, "Expected password: to be a String, got #{password.class}" unless password.is_a?(String)
before_action(options) { http_basic_authenticate_or_request_with name: name, password: password, realm: realm, message: message, content_type: content_type }
end
Defined in actionpack/lib/action_controller/metal/http_authentication.rb line 79
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods