方法
- A
- R
实例公共方法
authenticate_or_request_with_http_token(realm = "Application", message = nil, &login_procedure) 链接
使用 HTTP Bearer 令牌进行身份验证,否则会渲染一个 HTTP 标头,要求客户端发送 Bearer 令牌。要使身份验证被视为成功,login_procedure 的返回值不得为 false。通常,它会返回已认证的用户。
有关示例用法,请参阅 ActionController::HttpAuthentication::Token。
来源: 显示 | 在 GitHub 上
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 438 def authenticate_or_request_with_http_token(realm = "Application", message = nil, &login_procedure) authenticate_with_http_token(&login_procedure) || request_http_token_authentication(realm, message) end
authenticate_with_http_token(&login_procedure) 链接
使用 HTTP Bearer 令牌进行身份验证。如果找到令牌,则返回 login_procedure 的返回值。如果未找到令牌,则返回 nil。
有关示例用法,请参阅 ActionController::HttpAuthentication::Token。
来源: 显示 | 在 GitHub 上
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 446 def authenticate_with_http_token(&login_procedure) Token.authenticate(self, &login_procedure) end
request_http_token_authentication(realm = "Application", message = nil) 链接
渲染一个 HTTP 标头,要求客户端发送 Bearer 令牌进行身份验证。
来源: 显示 | 在 GitHub 上
# File actionpack/lib/action_controller/metal/http_authentication.rb, line 452 def request_http_token_authentication(realm = "Application", message = nil) Token.authentication_request(self, realm, message) end