# Digest auth with Rack/Metal

**URL:** <https://www.ruby-forum.com/t/digest-auth-with-rack-metal/178681>\
**Category:** Rails\
**Created:** [November 9, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/digest-auth-with-rack-metal/178681 "2009-11-09T14:22:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewmurcia](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7cd45c/32.png) [@matthewmurcia](https://www.ruby-forum.com/u/matthewmurcia)\
**Post date:** [November 9, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/digest-auth-with-rack-metal/178681/1 "2009-11-09T14:22:12Z")

</div>

Hi folks,

I’m trying to so some digest authentication in Rack via Metal. I’ve  
found the:

[http://rack.rubyforge.org/doc/Rack/Auth/Digest/MD5.html](http://rack.rubyforge.org/doc/Rack/Auth/Digest/MD5.html)

Class, but I don’t have a great idea of how this fits into metal. It  
seems like I should be able to do something similar to:

class MyAuth \< Rack::Auth::Digest::MD5

```
def initialize(app, realm=nil)
  super(app, (realm or "Awesome Auth")) do |username,password|
    username == 'bob' and password == 'jimbo'
  end
end

```

end

Any thoughts or experience using Rack::Auth::Digest::MD5? I think I  
could just instantiate it on each request, but it’s built _like_ a rack  
application so I don’t see why that’s needed.

Thanks all,

–  
Matthew B. :: 607 227 0871  
Resume & Portfolio @ [http://madhatted.com](http://madhatted.com)
