【发布时间】:2010-04-13 20:24:55
【问题描述】:
Rails 3 是否仍支持 HTTP 摘要身份验证?
我在 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
现在,Rails 3.0.0.beta 中的相同内容返回错误:
can't convert nil into String
是我遗漏了什么还是 Rails 3 中的错误? HTTP 基本身份验证工作正常。
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 http-authentication digest-authentication