WEBrick::HTTPAuth (Module)

In: webrick/httpauth.rb
webrick/httpauth/userdb.rb
webrick/httpauth/htpasswd.rb
webrick/httpauth/htgroup.rb
webrick/httpauth/htdigest.rb
webrick/httpauth/digestauth.rb
webrick/httpauth/basicauth.rb
webrick/httpauth/authenticator.rb

Public Instance methods

[Source]

# File webrick/httpauth.rb, line 22
    def _basic_auth(req, res, realm, req_field, res_field, err_type, block)
      user = pass = nil
      if /^Basic\s+(.*)/o =~ req[req_field]
        userpass = $1
        user, pass = decode64(userpass).split(":", 2)
      end
      if block.call(user, pass)
        req.user = user
        return
      end
      res[res_field] = "Basic realm=\"#{realm}\""
      raise err_type
    end

[Source]

# File webrick/httpauth.rb, line 36
    def basic_auth(req, res, realm, &block)
      _basic_auth(req, res, realm, "Authorization", "WWW-Authenticate",
                  HTTPStatus::Unauthorized, block)
    end

[Source]

# File webrick/httpauth.rb, line 41
    def proxy_basic_auth(req, res, realm, &block)
      _basic_auth(req, res, realm, "Proxy-Authorization", "Proxy-Authenticate",
                  HTTPStatus::ProxyAuthenticationRequired, block)
    end

[Validate]