ri > WEBrick::HTTPAuth::DigestAuth

πŸ”’ WEBrick::HTTPAuth::DigestAuth < Object

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ”§ Setup DigestAuth configconfig = { :Realm => 'DigestAuth example realm' }Define the authentication realm
πŸ“‚ Create password databasehtdigest = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'Open or create the digest password file
πŸ”‘ Set a user passwordhtdigest.set_passwd config[:Realm], 'username', 'password'Add or update a user’s password
πŸ’Ύ Flush password filehtdigest.flushWrite changes to disk
πŸ” Create DigestAuth objectdigest_auth = WEBrick::HTTPAuth::DigestAuth.new configInstantiate the digest authentication handler

πŸ“¦ Includes

πŸ“ Description

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'
  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.

πŸ› οΈ Class Methods

πŸ”§ Instance Methods

🏷️ Attributes

WEBrick::HTTPAuth::DigestAuth
πŸ”’ WEBrick::HTTPAuth::DigestAuth < Object πŸš€ Quick Reference
πŸ“¦ Includes πŸ“ Description πŸ› οΈ Class Methods πŸ”§ Instance Methods 🏷️ Attributes

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 05:41 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format