Method: WEBrick::HTTPAuth::DigestAuth#authenticate

Defined in:
lib/webrick/httpauth/digestauth.rb

#authenticate(req, res) ⇒ Object

Authenticates a req and returns a 401 Unauthorized using res if the authentication was not correct.



120
121
122
123
124
125
126
127
128
# File 'lib/webrick/httpauth/digestauth.rb', line 120

def authenticate(req, res)
  unless result = @mutex.synchronize{ _authenticate(req, res) }
    challenge(req, res)
  end
  if result == :nonce_is_stale
    challenge(req, res, true)
  end
  return true
end