るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. _builtin i

検索結果

WEBrick::HTTPAuth::Htpasswd (21089.0)

Apache の htpasswd 互換のクラスです。 .htpasswd ファイルを新しく作成することも出来ます。 htpasswd -m (MD5) や -s (SHA) で作成された .htpasswd ファイルには対応していません。

...ache の htpasswd 互換のクラスです。
.htpasswd ファイルを新しく作成することも出来ます。
htpasswd
-m (MD5) や -s (SHA) で作成された .htpasswd ファイルには対応していません。




require 'webrick'
i
nclude WEBrick
htpd = HTTPAuth::Htpasswd.new('do...
...t.htpasswd')
htpd.set_passwd(nil, 'username', 'supersecretpass')
htpd.flush
htpd2 = HTTPAuth::Htpasswd.new('dot.htpasswd')
pass = htpd2.get_passwd(nil, 'username', false)
p pass == 'supersecretpass'.crypt(pass[0,2])...

WEBrick::HTTPAuth::BasicAuth (9013.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...