Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

find the http-auth username in rails

in lighttpd
   1  
   2   auth.backend = your_preferred_method
   3   auth.backend.your_method.userfile = "yourfile.password"
   4   auth.require = ("/" => ("method" => "digest", "realm" => "your site", "require"=>"valid-user" ) )
   5  


in rails
   1  
   2  @request.env["HTTP_AUTHORIZATION"].scan(/Digest username=\W+["]?([a-z0-9]+)/i).to_s
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS