2017-10-06 97 views
0

我正在使用WSO2 Identity Server 5.3如何使用WSO2 Identity Server 5.3生成多值属性SAML2声明?

我必须通过用户配置文件生成一些带有一些多值属性的SAML2声明。

比方说,我有一个逗号分隔值列表特定要求,我必须用我的SAML断言响应以下结构组织的属性:

<saml2:Attribute Name="attribute1"> 
    <saml2:AttributeValue>value1</saml2:AttributeValue> 
    <saml2:AttributeValue>value2</saml2:AttributeValue> 
    <saml2:AttributeValue>value3</saml2:AttributeValue> 
    <saml2:AttributeValue>value4</saml2:AttributeValue> 
</saml2:Attribute> 

我配置的STS客户端获取SAML2断言以及我用多值声明设置的特定用户的声明。

我的问题是我得到的SAML断言响应为以下结构:

<saml2:Attribute Name="attribute1"> 
    <saml2:AttributeValue>value1,value2,value3,value4</saml2:AttributeValue> 
</saml2:Attribute> 

我安装上一个tomcat Travelocity的应用程序的实例,测试一次我得到了SAML断言登录后如预期应用程序并选择SAML流程。我可以通过查看Identity Server的日志文件来验证它。

我也使用STS客户端[1]以获取SAML断言,但是我得到的多值属性是该特定属性的逗号分隔值。

我直接用管理服务https://localhost:9443/services/wso2carbon-sts?wsdl作为我的客户端使用SOAP UI,但SAML响应与我之前说过的完全相同,多值属性作为该特定属性的逗号分隔值。

下面是我在属性声明部分获得的样本:

<saml2:AttributeStatement> 
    <saml2:Attribute Name="http://wso2.org/claims/im" NameFormat="http://wso2.org/claims/im"> 
     <saml2:AttributeValue 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">jairo_fernandezr,jb_fernandez 
     </saml2:AttributeValue> 
    </saml2:Attribute> 
    <saml2:Attribute Name="http://wso2.org/claims/emailaddress" NameFormat="http://wso2.org/claims/emailaddress"> 
     <saml2:AttributeValue 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">[email protected] 
     </saml2:AttributeValue> 
    </saml2:Attribute> 
    <saml2:Attribute Name="http://wso2.org/claims/givenname" NameFormat="http://wso2.org/claims/givenname"> 
     <saml2:AttributeValue 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Jairo 
     </saml2:AttributeValue> 
    </saml2:Attribute> 
</saml2:AttributeStatement> 

现在,我想问问你,如果有另一种方式来获得与结构为单值多值属性的SAML断言而不是使用管理服务https://localhost:9443/services/wso2carbon-sts?wsdl或另一种方法设置逗号分隔值,而无需设置travelocity应用程序。

[1] https://github.com/wso2/product-is/tree/5.x.x/modules/samples/sts

任何评论,将不胜感激。

感谢

+0

事实上,使用分隔值是wso2is处理多值属性的默认方式。我相信你可以实现自己创建saml响应的类(覆盖从声明中创建属性的方法),并将其配置到api-manager.xml中(我完全不记得界面,我可以检查一次办公室周一)。接下来你需要覆盖的是你自己的声明处理程序(这是类创建索赔的键/值图),但我会检查签名如何与你自己的实现工作。 – gusto2

+0

什么是你的用户存储?它是默认的LDAP吗? – farasath

+0

我有一个外部LDAP作为主用户存储,同时我也有一个AD作为辅助用户存储。 –

回答

0

WSO2身份服务器5.3.0正确的行为,当涉及到Web SAML SSO流程。

但是可以在默认情况下找到的服务wso2carbon-sts在https://localhost:9443/services/wso2carbon-sts处的行为与我在原始文章中描述的行为不同。

我已经向WSO2团队报告了这一情况,他们在Identity Server的项目中注册了一个错误,您可以看到详细信息here,如果您有兴趣,请跟进此事。

感谢您的支持

相关问题