Class: Mechanize::HTTP::AuthChallenge

### Home Classes Methods

### In Files

- lib/mechanize/http/auth_challenge.rb

### Parent

Object

### Methods

- #[]
- #initialize
- #realm
- #realm_name

### Files

- EXAMPLES.rdoc
- GUIDE.rdoc
- LICENSE.rdoc
- Manifest.txt
- README.rdoc

### Class/Module Index

Quicksearch

- Mechanize
- Mechanize::ChunkedTerminationError
- Mechanize::ContentTypeError
- Mechanize::Cookie
- Mechanize::CookieCMethods
- Mechanize::CookieDeprecated
- Mechanize::CookieIMethods
- Mechanize::CookieJar
- Mechanize::CookieJarIMethods
- Mechanize::DirectorySaver
- Mechanize::Download
- Mechanize::ElementMatcher
- Mechanize::Error
- Mechanize::File
- Mechanize::FileConnection
- Mechanize::FileRequest
- Mechanize::FileResponse
- Mechanize::FileSaver
- Mechanize::Form
- Mechanize::Form::Button
- Mechanize::Form::CheckBox
- Mechanize::Form::Field
- Mechanize::Form::FileUpload
- Mechanize::Form::Hidden
- Mechanize::Form::ImageButton
- Mechanize::Form::Keygen
- Mechanize::Form::MultiSelectList
- Mechanize::Form::Option
- Mechanize::Form::RadioButton
- Mechanize::Form::Reset
- Mechanize::Form::SelectList
- Mechanize::Form::Submit
- Mechanize::Form::Text
- Mechanize::Form::Textarea
- Mechanize::HTTP
- Mechanize::HTTP::Agent
- Mechanize::HTTP::AuthChallenge
- Mechanize::HTTP::AuthRealm
- Mechanize::HTTP::AuthStore
- Mechanize::HTTP::ContentDispositionParser
- Mechanize::HTTP::WWWAuthenticateParser
- Mechanize::Headers
- Mechanize::History
- Mechanize::Image
- Mechanize::Page
- Mechanize::Page::Base
- Mechanize::Page::Frame
- Mechanize::Page::Image
- Mechanize::Page::Label
- Mechanize::Page::Link
- Mechanize::Page::MetaRefresh
- Mechanize::Parser
- Mechanize::PluggableParser
- Mechanize::Prependable
- Mechanize::RedirectLimitReachedError
- Mechanize::RedirectNotGetOrHeadError
- Mechanize::ResponseCodeError
- Mechanize::ResponseReadError
- Mechanize::RobotsDisallowedError
- Mechanize::TestCase
- Mechanize::UnauthorizedError
- Mechanize::UnsupportedSchemeError
- Mechanize::Util
- Mechanize::XmlFile
- HTTP
- HTTP::CookieJar

No matching classes.

# Mechanize::HTTP::AuthChallenge

A parsed WWW-Authenticate header

### Attributes

params[RW]

The authentication parameters

scheme[RW]

The authentication scheme

### Public Instance Methods

[](param) click to toggle source

Retrieves `param` from the params list

    # File lib/mechanize/http/auth_challenge.rb, line 31
    def [] param
      params[param]
    end

initialize(scheme = nil, params = nil) click to toggle source

Creates a new AuthChallenge header with the given scheme and parameters

    # File lib/mechanize/http/auth_challenge.rb, line 28

realm(uri) click to toggle source

Constructs an AuthRealm for this challenge

    # File lib/mechanize/http/auth_challenge.rb, line 38
    def realm uri
      case scheme
      when 'Basic' then
        raise ArgumentError, "provide uri for Basic authentication" unless uri
        Mechanize::HTTP::AuthRealm.new scheme, uri + '/', self['realm']
      when 'Digest' then
        Mechanize::HTTP::AuthRealm.new scheme, uri + '/', self['realm']
      else
        raise Mechanize::Error, "unknown HTTP authentication scheme #{scheme}"
      end
    end

realm_name() click to toggle source

The name of the realm for this challenge

    # File lib/mechanize/http/auth_challenge.rb, line 53
    def realm_name
      params['realm'] if Hash === params # NTLM has a string for params
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.