33件ヒット
[1-33件を表示]
(0.128秒)
ライブラリ
キーワード
- BasicAuth (11)
- DigestAuth (11)
- Htdigest (11)
検索結果
-
WEBrick
:: HTTPAuth :: BasicAuth (18037.0) -
HTTP の Basic 認証のためのクラスです。
...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', '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 :: Htdigest (18025.0) -
Apache の htdigest 互換のクラス。
...Apache の htdigest 互換のクラス。
例
require 'webrick'
include WEBrick
htd = HTTPAuth::Htdigest.new('dot.htdigest')
htd.set_passwd('realm', 'username', 'supersecretpass')
htd.flush
htd2 = HTTPAuth::Htdigest.new('dot.htdigest')
p htd2.get_passwd('realm', 'username', false) == '65fe0... -
WEBrick
:: HTTPAuth :: DigestAuth (15037.0) -
HTTP の Digest 認証のためのクラスです。
...HTTP の Digest 認証のためのクラスです。
2617 も参照してください。
例:
require 'webrick'
config = { :Realm => 'DigestAuth example realm' }
htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htdigest.set_passwd config[:Realm], 'username', 'password'
htdi......gest.flush
config[:UserDB] = htdigest
digest_auth = WEBrick::HTTPAuth::DigestAuth.new config
サーブレットの initialize メソッドの中でこのクラスのインスタンスを作成
しないようにしてください。デフォルトでは WEBrick はリクエストのたびに......サー
ブレットのインスタンスを生成しますが、
WEBrick::HTTPAuth::DigestAuth のオブジェクトはリクエストをまたい
で利用しなければならないためです。...