module ActionController::HttpAuthentication::Token
def authentication_request(controller, realm, message = nil)
* +controller+ - ActionController::Base instance for the outgoing response.
==== Parameters
Returns nothing.
Sets a WWW-Authenticate header to let the client know a token is desired.
def authentication_request(controller, realm, message = nil) message ||= "HTTP Token: Access denied.\n" controller.headers["WWW-Authenticate"] = %(Token realm="#{realm.tr('"', "")}") controller.__send__ :render, plain: message, status: :unauthorized end