跳至内容 跳至搜索
方法
A
R

实例公共方法

authenticate_or_request_with_http_digest(realm = "Application", message = nil, &password_procedure)

使用 HTTP Digest 进行身份验证,否则渲染 HTTP 标头,要求客户端发送 Digest

请参阅 ActionController::HttpAuthentication::Digest 获取示例用法。

# File actionpack/lib/action_controller/metal/http_authentication.rb, line 197
def authenticate_or_request_with_http_digest(realm = "Application", message = nil, &password_procedure)
  authenticate_with_http_digest(realm, &password_procedure) || request_http_digest_authentication(realm, message)
end

authenticate_with_http_digest(realm = "Application", &password_procedure)

使用 HTTP Digest 进行身份验证。如果身份验证成功,则返回 true,否则返回 false。

# File actionpack/lib/action_controller/metal/http_authentication.rb, line 203
def authenticate_with_http_digest(realm = "Application", &password_procedure)
  HttpAuthentication::Digest.authenticate(request, realm, &password_procedure)
end

request_http_digest_authentication(realm = "Application", message = nil)

渲染 HTTP 标头,要求客户端发送 Digest 用于身份验证。

# File actionpack/lib/action_controller/metal/http_authentication.rb, line 209
def request_http_digest_authentication(realm = "Application", message = nil)
  HttpAuthentication::Digest.authentication_request(self, realm, message)
end