方法
- 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