Method: Ramaze::Helper::HttpDigest#httpdigest_lookup

Defined in:
lib/ramaze/helper/httpdigest.rb

#httpdigest_lookup(username, realm) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ramaze/helper/httpdigest.rb', line 53

def httpdigest_lookup(username, realm)
  if block_given?
    yield(username)
  elsif respond_to?(:httpdigest_lookup_password)
    httpdigest_lookup_password(username)
  elsif respond_to?(:httpdigest_lookup_plaintext_password)
    plain = httpdigest_lookup_plaintext_password(username)
    Digest::MD5.hexdigest([username, realm, plain].join(':'))
  else
    raise "No password lookup handler found"
  end
end