るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.064秒)

別のキーワード

  1. _builtin to_h
  2. hash to_h
  3. enumerable to_h
  4. openstruct to_h
  5. struct to_h

検索結果

WEBrick::HTTPAuth::BasicAuth (33019.0)

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

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



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

h
tpd = WEBrick::HTTPAuth::Htpasswd.new('dot.htpasswd')
h
tpd.set_passwd(nil, 'username', 'supersecre...
...tpass')

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

WEBrick::HTTPAuth::Authenticator#userdb -> WEBrick::HTTPAuth::Htpasswd | WEBrick::HTTPAuth::Htdigest (12607.0)

認証のためのユーザデータベースを返します。

...認証のためのユーザデータベースを返します。

@see WEBrick::HTTPAuth::BasicAuth, WEBrick::HTTPAuth::Htdigest...