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.


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

AuthScheme = "Digest"


[R] qop

Quality of protection. RFC 2617 defines “auth” and “auth-int”

[R] algorithm

Digest authentication algorithm

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