Type:
Class
Constants:
AuthScheme : "Digest"
OpaqueInfo : Struct.new(:time, :nonce, :nc)

Struct containing the opaque portion of the digest authentication

RFC 2617 Digest Access Authentication for WEBrick

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

Here is an example of how to set up DigestAuth:

1
2
3
4
5
6
7
8
9
config = { :Realm => 'DigestAuth example realm' }
 
htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htdigest.set_passwd config[:Realm], 'username', 'password'
htdigest.flush
 
config[:UserDB] = htdigest
 
digest_auth = WEBrick::HTTPAuth::DigestAuth.new config

When using this as with a servlet be sure not to create a new DigestAuth object in the servlet's initialize. By default WEBrick creates a new servlet instance for every request and the DigestAuth object must be used across requests.

make_passwd
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::DigestAuth

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

2025-01-10 15:47:30
new
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::DigestAuth

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

2025-01-10 15:47:30
challenge
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::DigestAuth

challenge(req, res, stale=false) Instance Public methods Returns a challenge

2025-01-10 15:47:30
authenticate
  • References/Ruby on Rails/Ruby/Classes/WEBrick/WEBrick::HTTPAuth/WEBrick::HTTPAuth::DigestAuth

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

2025-01-10 15:47:30