Skip to content

Instantly share code, notes, and snippets.

@Milhouse
Created February 19, 2009 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Milhouse/67053 to your computer and use it in GitHub Desktop.
Save Milhouse/67053 to your computer and use it in GitHub Desktop.
ADMIN_REALM = "Admin Realm"
USERS_REALM = "Users Realm"
REALM_USERS = {
ADMIN_REALM => {
"dhh" => "as",
"don" => "ap"},
USERS_REALM => {
"dhh" => "us",
"don" => "up"}
}
def authenticate
authenticate_or_request_with_http_digest(USERS_REALM) do |username|
REALM_USERS[USERS_REALM][username]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment