るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.128秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:HTTPAuth[x] > クエリ:realm[x] > 種類:クラス[x]

別のキーワード

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

検索結果

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})

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::Htdigest (18025.0)

Apache の htdigest 互換のクラス。

...Apache の htdigest 互換のクラス。



require 'webrick'
i
nclude WEBrick
h
td = HTTPAuth::Htdigest.new('dot.htdigest')
h
td.set_passwd('realm', 'username', 'supersecretpass')
h
td.flush
h
td2 = 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' }

h
tdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
h
tdigest.set_passwd config[:Realm], 'username', 'password'
h
tdi...
...gest.flush

config[:UserDB] = htdigest

digest_auth = WEBrick::HTTPAuth::DigestAuth.new config

サーブレットの initialize メソッドの中でこのクラスのインスタンスを作成
しないようにしてください。デフォルトでは WEBrick はリクエストのたびに...
...サー
ブレットのインスタンスを生成しますが、
WEBrick::HTTPAuth::DigestAuth のオブジェクトはリクエストをまたい
で利用しなければならないためです。...