之前配置的客户端url都是写死的,没法在不同的环境进行切换;
CAS官方也想到了这点,于是提供了方法:
https://github.com/apereo/java-cas-client#configuration
https://gazelle.ihe.net/content/gazelle-sso-clients-cas-515
设置配置方式
<context-param>
<param-name>configurationStrategy</param-name>
<param-value>PROPERTY_FILE</param-value>
</context-param>
<context-param>
<param-name>configFileLocation</param-name>
<param-value>/opt/cas/file.properties</param-value>
</context-param>
/opt/cas/file.properties 文件内容:
serverName=http://localhost
casServerUrlPrefix=https://sso.ihe-europe.net/cas
casServerLoginUrl=https://sso.ihe-europe.net/cas/login
casLogoutUrl=https://sso