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