Rails 3 HTTP digest authentication

Posted by Cimm on Stack Overflow See other posts from Stack Overflow or by Cimm
Published on 2010-04-13T20:24:55Z Indexed on 2010/05/01 16:07 UTC
Read the original article Hit count: 297

Is HTTP digest authentication still supported in Rails 3?

I tried the following code in Rails 2.3.5, it works.

class Admin::BaseController < ApplicationController
  before_filter :authenticate
  USERS = { "lifo" => "world" }
  def authenticate
    authenticate_or_request_with_http_digest("Application") do |name|
      USERS[name]
    end
  end
end

Now, the same thing in Rails 3.0.0.beta) returns an error:

can't convert nil into String

Am I missing something or is this a bug in Rails 3? HTTP basic authentication works fine.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about rails3