Parent

Net::HTTPHeader::DigestAuthenticator

Public Class Methods

new(username, password, method, path, response_header) click to toggle source
# File lib/httparty/net_digest_auth.rb, line 13
def initialize(username, password, method, path, response_header)
  @username = username
  @password = password
  @method   = method
  @path     = path
  @response = parse(response_header)
end

Public Instance Methods

authorization_header() click to toggle source
# File lib/httparty/net_digest_auth.rb, line 21
def authorization_header
  @cnonce = md5(random)
  header = [%(Digest username="#{@username}"),
    %(realm="#{@response['realm']}"),
    %(nonce="#{@response['nonce']}"),
    %(uri="#{@path}"),
    %(response="#{request_digest}")]
  [%(cnonce="#{@cnonce}"),
    %(opaque="#{@response['opaque']}"),
    %(qop="#{@response['qop']}"),
    %(nc="0")].each { |field| header << field } if qop_present?
  header
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.