2012-05-03 17 views
1

我遵循https://github.com/nbudin/devise_cas_authenticatable的說明。然而,使用這個和before_filter :authenticate_user!仍然會讓應用嘗試使用數據庫身份驗證策略進行身份驗證。下面是設計配置文件:無法使用devise_cas_authenticatable進行身份驗證

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 

謝謝!

回答

1

你用你的用戶模型替換了:database_authenticatable嗎?

devise :cas_authenticatable, ... 

devise_cas_authenticatable在github自述。

相關問題