1

我正在遵循https://github.com/nbudin/devise_cas_authenticable上的说明。但是,使用它before_filter :authenticate_user!仍然会使应用程序尝试使用设计的数据库身份验证策略进行身份验证。下面是设计配置文件:

Devise.setup do |config|
  require 'devise/orm/active_record'

  config.cas_base_url = 'https://cas.uwaterloo.ca/cas'

  # If true, uses the password salt as remember token. This should be turned
  # to false if you are not using database authenticatable.
  config.use_salt_as_remember_token = true

  # ==> Configuration for :token_authenticatable
  # Defines name of the authentication token params key
  config.token_authentication_key = :auth_token

  # The default HTTP method used to sign out a resource. Default is :delete.
  config.sign_out_via = :delete
end

谢谢!

4

1 回答 1

1

:database_authenticatable在你的用户模型中替换了吗?

devise :cas_authenticatable, ...

请参阅devise_cas_authenticatablegithub 上的自述文件。

于 2012-05-25T09:47:49.373 回答