我正在尝试部署 CAS 服务器和客户端。首先,在 CAS 服务器上的 deployerConfigContext.xml 中有我的配置:
<bean class="org.jasig.cas.services.RegexRegisteredService">
<property name="id" value="1" />
<property name="name" value="HTTP and IMAP on localhost:8080/firstCasClient" />
<property name="description" value="Allows HTTP(S) and IMAP(S) protocols on localhost:8080/firstCasClient" />
<property name="serviceId" value="^(https?|imaps?)://([A-Za-z0-9_-]+\.)*localhost:8080/firstCasClient/*" />
<property name="evaluationOrder" value="0" />
</bean>
在我的客户上,我使用这样的过滤器:
<!-- CAS -->
<filter>
<filter-name>CAS Authentication Filter</filter-name>
<filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
<init-param>
<param-name>casServerLoginUrl</param-name>
<param-value>http://localhost:8888/cas-server-webapp-3.5.2/login</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8080/firstCasClient</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS Validation Filter</filter-name>
<filter-class>org.jasig.cas.client.validation.Saml11TicketValidationFilter</filter-class>
<init-param>
<param-name>casServerUrlPrefix</param-name>
<param-value>http://localhost:8888/cas-server-webapp-3.5.2</param-value>
</init-param>
<init-param>
<param-name>serverName</param-name>
<param-value>http://localhost:8080/firstCasClient</param-value>
</init-param>
</filter>
<filter>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>CAS Authentication Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS Validation Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
所以当我去时http://localhost:8080/firstCasClient/
,它工作正常,我来到 CAS 身份验证页面。但经过良好的身份验证后,CAS 将我重定向到此 url:
http://localhost:8080/firstCasClient/firstCasClient/firstCasClient/
我不明白为什么,所以我来请你帮忙。我希望有人可以帮助我:)