Module: ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods
- Defined in:
 - lib/action_controller/metal/http_authentication.rb
 
Instance Method Summary collapse
- 
  
    
      #http_basic_authenticate_with(name:, password:, realm: nil, **options)  ⇒ Object 
    
    
  
  
  
  
  
  
  
  
  
    
Enables HTTP Basic authentication.
 
Instance Method Details
#http_basic_authenticate_with(name:, password:, realm: nil, **options) ⇒ Object
Enables HTTP Basic authentication.
See ActionController::HttpAuthentication::Basic for example usage.
      76 77 78 79 80  | 
    
      # File 'lib/action_controller/metal/http_authentication.rb', line 76 def http_basic_authenticate_with(name:, password:, realm: nil, **) 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() { http_basic_authenticate_or_request_with name: name, password: password, realm: realm } end  |