CAS 和 Spring 安全特殊字符

CAS and Spring Security special characters

我有 2 个使用 CAS 的应用程序。我有问题,因为当我向 CAS 询问分配给票证的用户时,我已经变成了错误的编码答案。有任何特殊字符(来自 UTF-8)。
我在 web.xml 中正确设置了字符编码,并更改了服务器中的设置以允许 UTF-8,但它仍然不起作用。你知道什么是问题吗?
在 Cas20ServiceTicketValidator 的 cas 响应中,我变成了:
albaner.dÄ…b

但我预计:
albaner.döb

你能post你的web.xml文件吗?

我建议您在 cas 客户端的 web.xml 中包含以下内容,

<filter>
    <filter-name>characterEncodingFilter</filter-name>
    <filter-class>
        org.springframework.web.filter.CharacterEncodingFilter
    </filter-class>
    <init-param>
        <param-name>encoding</param-name>
        <param-value>UTF-8</param-value>
    </init-param>
</filter>
<filter-mapping>
    <filter-name>characterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

我的推荐是根据以下内容link, http://docs.spring.io/spring-security/site/docs/3.2.9.RELEASE/reference/htmlsingle/#cas-singlelogout

虽然此文档参考严格适用于单点注销,但是,我觉得您的编码问题是相似的。

When using the SingleSignOutFilter you might encounter some encoding issues. Therefore it is recommended to add the CharacterEncodingFilter to ensure that the character encoding is correct when using the SingleSignOutFilter. Again, refer to JASIG’s documentation for details. The SingleSignOutHttpSessionListener ensures that when an HttpSession expires, the mapping used for single logout is removed.