instance method
authentication_request
Ruby on Rails 4.0.13
Since v3.0.20Signature
authentication_request(controller, realm)
Sets a WWW-Authenticate to let the client know a token is desired.
controller - ActionController::Base instance for the outgoing response. realm - String realm to use in the header.
Returns nothing.
Parameters
-
controllerreq -
realmreq
Source
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 491
def authentication_request(controller, realm)
controller.headers["WWW-Authenticate"] = %(Token realm="#{realm.gsub(/"/, "")}")
controller.__send__ :render, :text => "HTTP Token: Access denied.\n", :status => :unauthorized
end
Defined in actionpack/lib/action_controller/metal/http_authentication.rb line 491
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::HttpAuthentication::Token