Parent

Mechanize::HTTP::AuthChallenge

A parsed WWW-Authenticate header

Attributes

scheme[RW]

The authentication scheme

params[RW]

The authentication parameters

Public Instance Methods

[](param) click to toggle source

Retrieves param from the params list

    # File lib/mechanize/http/auth_challenge.rb, line 28
28:     def [] param
29:       params[param]
30:     end
initialize(scheme click to toggle source

Creates a new AuthChallenge header with the given scheme and parameters

    # File lib/mechanize/http/auth_challenge.rb, line 25
25:     
realm(uri) click to toggle source

Constructs an AuthRealm for this challenge

    # File lib/mechanize/http/auth_challenge.rb, line 35
35:     def realm uri
36:       case scheme
37:       when 'Basic' then
38:         raise ArgumentError, "provide uri for Basic authentication" unless uri
39:         Mechanize::HTTP::AuthRealm.new scheme, uri + '/', self['realm']
40:       when 'Digest' then
41:         Mechanize::HTTP::AuthRealm.new scheme, uri + '/', self['realm']
42:       else
43:         raise Mechanize::Error, "unknown HTTP authentication scheme #{scheme}"
44:       end
45:     end
realm_name() click to toggle source

The name of the realm for this challenge

    # File lib/mechanize/http/auth_challenge.rb, line 50
50:     def realm_name
51:       params['realm'] if Hash === params # NTLM has a string for params
52:     end
to_s() click to toggle source

The reconstructed, normalized challenge

    # File lib/mechanize/http/auth_challenge.rb, line 57
57:     def to_s
58:       auth_params = params.map { |name, value| "#{name}=\"#{value}\"" }
59: 
60:       "#{scheme} #{auth_params.join ', '}"
61:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.