るりまサーチ

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

別のキーワード

  1. rexml/document new
  2. rexml/document write
  3. rexml/document node_type
  4. rexml/document clone
  5. rexml/document to_s

ライブラリ

キーワード

検索結果

WEBrick::HTTPAuth::BasicAuth#authenticate(request, response) -> bool (32101.0)

クライアントから送られてきたユーザ名とパスワードを認証します。 認証に失敗した場合は challenge を呼びます。

...した場合は challenge を呼びます。

@param request WEBrick::HTTPRequest のインスタンスを指定します。

@param response WEBrick::HTTPResponse のインスタンスを指定します。

@raise WEBrick::HTTPStatus::Unauthorized 認証に失敗した場合に発生します。...

WEBrick::HTTPAuth::BasicAuth (14040.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::BasicAuth#challenge(request, response) -> () (14016.0)

クライアントにパスワードを要求するためにレスポンスに WWW-Authenticate ヘッダを 設定し、例外 WEBrick::HTTPStatus::Unauthorized を投げます。

...クライアントにパスワードを要求するためにレスポンスに WWW-Authenticate ヘッダを
設定し、例外 WEBrick::HTTPStatus::Unauthorized を投げます。

@raise WEBrick::HTTPStatus::Unauthorized このメソッドを呼ぶと必ず発生します。...