在 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