Module: ActionController::HttpAuthentication::Digest::ControllerMethods

Defined in:
lib/action_controller/http_authentication.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_or_request_with_http_digest(realm = "Application", &password_procedure) ⇒ Object



159
160
161
# File 'lib/action_controller/http_authentication.rb', line 159

def authenticate_or_request_with_http_digest(realm = "Application", &password_procedure)
  authenticate_with_http_digest(realm, &password_procedure) || request_http_digest_authentication(realm)
end

#authenticate_with_http_digest(realm = "Application", &password_procedure) ⇒ Object

Authenticate with HTTP Digest, returns true or false



164
165
166
# File 'lib/action_controller/http_authentication.rb', line 164

def authenticate_with_http_digest(realm = "Application", &password_procedure)
  HttpAuthentication::Digest.authenticate(self, realm, &password_procedure)
end

#request_http_digest_authentication(realm = "Application", message = nil) ⇒ Object

Render output including the HTTP Digest authentication header



169
170
171
# File 'lib/action_controller/http_authentication.rb', line 169

def request_http_digest_authentication(realm = "Application", message = nil)
  HttpAuthentication::Digest.authentication_request(self, realm, message)
end