Type:
Class
Constants:
AuthScheme : "Basic"

Basic Authentication for WEBrick

Use this class to add basic authentication to a WEBrick servlet.

Here is an example of how to set up a BasicAuth:

config = { :Realm => 'BasicAuth example realm' }

htpasswd = WEBrick::HTTPAuth::Htpasswd.new 'my_password_file'
htpasswd.set_passwd config[:Realm], 'username', 'password'
htpasswd.flush

config[:UserDB] = htpasswd

basic_auth = WEBrick::HTTPAuth::BasicAuth.new config
make_passwd

make_passwd(realm, user, pass) Class Public methods Used by

2015-06-11 14:27:17
new

new(config, default=Config::BasicAuth) Class Public methods Creates a new

2015-06-11 14:29:08
challenge

challenge(req, res) Instance Public methods Returns a challenge response which

2015-06-11 14:32:52
authenticate

authenticate(req, res) Instance Public methods Authenticates a req

2015-06-11 14:30:56