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:

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

htdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htdigest.set_passwd config[:Realm], 'username', 'password'

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.


AuthScheme = "Digest"

OpaqueInfo = Struct.new(:time, :nonce, :nc)

MustParams = ['username','realm','nonce','uri','response']

MustParamsAuth = ['cnonce','nc']


[R] algorithm
[R] qop
Show files where this class is defined (1 file)
Register or log in to add new notes.