class HTTPClient::AuthFilterBase
Common abstract class for authentication filter.
There are 2 authentication filters.
WWWAuth
-
Authentication filter for handling authentication negotiation between Web server. Parses 'WWW-Authentication' header in response and generates 'Authorization' header in request.
ProxyAuth
-
Authentication filter for handling authentication negotiation between Proxy server. Parses 'Proxy-Authentication' header in response and generates 'Proxy-Authorization' header in request.
Private Instance Methods
parse_authentication_header(res, tag)
click to toggle source
# File lib/httpclient/auth.rb, line 32 def parse_authentication_header(res, tag) challenge = res.header[tag] return nil unless challenge challenge.collect { |c| parse_challenge_header(c) }.compact end
parse_challenge_header(challenge)
click to toggle source
# File lib/httpclient/auth.rb, line 38 def parse_challenge_header(challenge) scheme, param_str = challenge.scan(/\A(\S+)(?:\s+(.*))?\z/)[0] return nil if scheme.nil? return scheme, param_str end