るりまサーチ

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

別のキーワード

  1. webrick/httpauth/authenticator requestfield
  2. webrick/httpauth/authenticator responsefield
  3. webrick/httpauth/authenticator authexception
  4. authenticator userdb

検索結果

WEBrick::HTTPAuth::Authenticator#realm -> String (21101.0)

レルムを返します。

レルムを返します。

WEBrick::HTTPAuth::BasicAuth (36.0)

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

...

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

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

authenticator
= WEBrick::HTTPAuth::Basi...
...cAuth.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...