【问题标题】:Japanese characters in authentication response attributes are rturned as question marks认证响应属性中的日文字符被转为问号
【发布时间】:2016-03-02 05:04:14
【问题描述】:

所以 Spring Security Saml Sample application 中的认证响应如下所示(属性值为问号):

<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_670fb4839b61c1398a1acb39e56ee5e6" ..>
    <saml2:AttributeStatement>
        <saml2:Attribute FriendlyName="userName" Name="urn:com.example:userName"
                         NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
            <saml2:AttributeValue>???????</saml2:AttributeValue>
        </saml2:Attribute>
 </saml2:Assertion>

我使用 Shibboleth 作为 IdP,在 IdP 的日志中我看到身份验证响应 xml(加密之前)包含实际值,而不是问号。

知道如何正确阅读它们吗?或者检查它们在哪里被打乱了。

更新 #1 (2016-03-03)

我暂时禁用了 saml 断言的加密,分析了 IdP 和 SP 之间的 HTTP 流量,并且我看到日文字符在身份验证响应中正常到达浏览器。这证明 Spring Security Saml Sample 无法正确解码/显示它们。我会继续寻找解决这个问题的方法。

【问题讨论】:

    标签: spring-saml


    【解决方案1】:

    我所要做的就是添加

    <%@ page contentType="text/html; charset=UTF-8" %>
    

    到 Spring Security Saml Sample 应用程序的 index.jsp 以使页面日文字符正确显示。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-25
      • 2015-09-16
      • 1970-01-01
      • 2017-02-09
      • 2016-04-16
      • 1970-01-01
      • 2011-07-02
      • 2012-06-15
      相关资源
      最近更新 更多