【发布时间】:2019-05-02 02:19:49
【问题描述】:
我正在 office365 和使用 SAML 2 进行身份验证的帮助台应用程序之间设置 wso2。应用程序期望 NameID.wso2is 身份提供者中的用户名在 NameID 字段中发送类似 guid 的 id,而不是我在应用程序中需要的别名字段。
除了定义别名声明之外,我已经完成了此文档 https://github.com/wso2-extensions/identity-outbound-auth-office365/blob/v1.0.4/docs/config.md 中的所有步骤,然后在服务提供商中添加了 NameID 到别名的自定义映射以及指定主题 uri 到 NameID 声明
<saml2:Subject>
<saml2:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified">0cccccc-444444-45553-1111-92387492387@23423423-sdfs-3333-5555-222222222</saml2:NameID>
<saml2:AttributeStatement>
<saml2:Attribute Name="Alias"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>j.smith</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="DisplayName"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>John Smith</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="Id"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>0cccccc-444444-45553-1111-92387492387@23423423-sdfs-3333-5555-222222222</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="@odata.context"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>https://outlook.office365.com/api/v2.0/$metadata#Me</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="EmailAddress"
NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:basic"
>
<saml2:AttributeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="xs:string"
>a@b.com</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
</saml2:Assertion>
我需要 NameID 是 NameID 才能成为别名属性中的 j.smith
j.史密斯
【问题讨论】: