type=class
superclass=Object
included=WEBrick=HTTPAuth=Authenticator
extended=
dynamically_included=
dynamically_extended=
library=webrick.httpauth.basicauth
aliases=
aliasof=

HTTP の Basic 認証のためのクラスです。

例

    realm = "WEBrick's realm"
    srv = HTTPServer.new({ :BindAddress => '127.0.0.1', :Port => 10080})

    htpd = HTTPAuth::Htpasswd.new('dot.htpasswd')
    htpd.set_passwd(nil, 'username', 'supersecretpass')

    authenticator = HTTPAuth::BasicAuth.new(:UserDB => htpd, :Realm => realm)
    srv.mount_proc('/basic_auth') {|req, res|
      authenticator.authenticate(req, res)
      res.body = "hoge"
    }
