4

HTTPダイジェスト認証はRails3でも引き続きサポートされますか?

Rails 2.3.5で次のコードを試しましたが、動作します。

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

これで、Rails3.0.0.betaの同じものがエラーを返します。

can't convert nil into String

私は何かが足りないのですか、それともこれはRails 3のバグですか?HTTP基本認証は正常に機能します。

4

1 に答える 1

1

Railsbeta2でも同じ問題があります。

迅速で汚い修正:

追加

self.config.secret = "result of rake secret"

authenticate_or_request_with_http_digest("Application")
于 2010-05-01T16:02:42.127 に答える