跳至内容 跳至搜索
方法
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 193
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 199
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 205
def request_http_digest_authentication(realm = "Application", message = nil)
  HttpAuthentication::Digest.authentication_request(self, realm, message)
end