- A
- R
Instance Public methods
authenticate_or_request_with_http_token(realm = "Application", message = nil, content_type = nil, scheme: nil, &login_procedure) Link
Authenticate using an HTTP token, or otherwise render an HTTP header requesting the client to send a token. For the authentication to be considered successful, login_procedure must not return a false value. Typically, the authenticated user is returned.
The optional scheme restricts authentication to that scheme (or any of them, when given an array) and uses it verbatim for the WWW-Authenticate response header. Any scheme name can be required. When no scheme is given, "Token", "Bearer", and "DPoP" are accepted. The request’s authentication scheme is yielded as a downcased symbol in an optional third argument to login_procedure.
See ActionController::HttpAuthentication::Token for example usage.
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 449 def authenticate_or_request_with_http_token(realm = "Application", message = nil, content_type = nil, scheme: nil, &login_procedure) authenticate_with_http_token(scheme:, &login_procedure) || request_http_token_authentication(realm, message, content_type, scheme:) end
authenticate_with_http_token(scheme: nil, &login_procedure) Link
Authenticate using an HTTP token. Returns the return value of login_procedure if a token is found. Returns nil if no token is found.
See ActionController::HttpAuthentication::Token for example usage.
request_http_token_authentication(realm = "Application", message = nil, content_type = nil, scheme: nil) Link
Render an HTTP header requesting the client to send a token for authentication.