instance method http_basic_authenticate_with

Ruby on Rails 4.1.16

Since v3.1.12

Available in: v3.1.12 v3.2.22.5 v4.0.13 v4.1.16 v4.2.9 v5.2.8.1 v6.0.6 v6.1.7.10 v7.0.10 v7.1.6 v7.2.3 v8.0.4 v8.1.2

Signature

http_basic_authenticate_with(options = {})

No documentation comment.

Parameters

options opt = {}
Source
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 71
          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

Defined in actionpack/lib/action_controller/metal/http_authentication.rb line 71 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods

Type at least 2 characters to search.

↑↓ navigate · open · esc close