2012-05-25 3 views
0

Refinery에 CAS 인증을 추가하는 방법을 알아 내려고합니다. 지금까지 찾은 최고의 배열은 devise_cas_authenticatable입니다.Refinery CMS + devise_cas_authenticatable

나는 rake refinery:override model=user을 사용 :database_authenticatable 대체 :

# /app/models/refinery/user.rb 
if self.respond_to?(:devise) 
    devise :cas_authenticatable, ... 
end 

을하지만 CAS 구성 값을 설정 위치를 찾을 수없는 예 : 기존의 초기화가있는 경우

Devise.setup do |config| 
    ... 
    config.cas_base_url = "https://cas.myorganization.com" 
    ... 
end 

사람이 알고 있나요 이게 어디에 속한거야? 또한 정유소를 CAS와 함께 작동시키는 작업에 대한 생각은 도움이 될 것입니다. 감사!

답변

0

Rails 초기화 프로그램에서 CAS 구성 값을 설정하십시오.

$ cat config/initializers/devise.rb 

Devise.setup do |config| 
    config.cas_base_url = "https://cas.myorganization.com" 

    # you can override these if you need to, but cas_base_url is usually enough 
    # config.cas_login_url = "https://cas.myorganization.com/login" 
    # config.cas_logout_url = "https://cas.myorganization.com/logout" 
    # config.cas_validate_url = "https://cas.myorganization.com/serviceValidate" 

    # The CAS specification allows for the passing of a follow URL to be displayed when 
    # a user logs out on the CAS server. RubyCAS-Server also supports redirecting to a 
    # URL via the destination param. Set either of these urls and specify either nil, 
    # 'destination' or 'follow' as the logout_url_param. If the urls are blank but 
    # logout_url_param is set, a default will be detected for the service. 
    # config.cas_destination_url = 'https://cas.myorganization.com' 
    # config.cas_follow_url = 'https://cas.myorganization.com' 
    # config.cas_logout_url_param = nil 

    # By default, devise_cas_authenticatable will create users. If you would rather 
    # require user records to already exist locally before they can authenticate via 
    # CAS, uncomment the following line. 
    # config.cas_create_user = false 
end