我正在为SSO在ADFS中集成Spring扩展。我使用ADFS2.0作为IDP,并为Spring应用程序生成元数据,并将元数据导入ADFS。我将传递电子邮件地址和显示名称到spring应用程序。
下面是我在ADFS中设置的索赔规则。
1获取属性
c:[Type == "http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname", Issuer == "AD AUTHORITY"]
=> issue(store = "Active Directory", types = ("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name", "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"), query = ";displayName,mail;{0}", param = c.Value);2发送电子邮件地址作为名称ID
C:类型"http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress“=>问题(Type= "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier",Issuer = c.Issuer,OriginalIssuer = c.OriginalIssuer,Value = c.Value,ValueType = c.ValueType,Properties"http://schemas.xmlsoap.org/ws/2005/05/identity/claimproperties/format”= "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress");]
我可以登录Spring应用程序。在一般信息中,信息是正确的。但在校长的属性部分。属性值变为org.opensaml.xml.schema.impl.XSAnyImpl@5abb6d06和org.opensaml.xml.schema.impl.XSAnyImpl@46f2d373.
有人知道为什么会这样吗?我怎么才能修好它呢?
非常感谢。
发布于 2015-01-02 10:32:26
您应该更新到SpringSAML1.0.0.RELEASE(可在弹簧回收中找到)。发行版包含帮助器方法,它们正确地处理XSAny元素中的字符串值。有关示例,请参阅sample项目中的文件sample。关于SAMLCredential实例的有用方法是:
String value = credential.getAttributeAsString("attributeName");和
String[] value = credential.getAttributeAsStringArray("attributeName");https://stackoverflow.com/questions/27738881
复制相似问题