【问题标题】:SAML Request Attributes In AuthnRequestAuthnRequest 中的 SAML 请求属性
【发布时间】:2016-03-08 17:05:08
【问题描述】:

我有点了解基本 SAML 身份验证应该如何工作:

SP 的用户请求资源
SP 向 IDP 发送身份验证请求
IDP 对用户进行身份验证并发送回一些 userId
SP 使用 userId
向 IDP 发送属性查询以获取更多详细信息 IDP 发回属性
SP给用户资源

我的问题是,你能以任何方式绕过 AttributeQuery。当我向我的测试 Gluu/Shibboleth 服务器发出 SAML 2.0 请求时,我会返回 givenName(名字)和 sn(姓氏)。 我是否可以仅在 AuthnRequest 中请求 inum 用户 ID 和电子邮件?

我的要求很简单:

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" ID="MyPrefix1457456412304" Version="2.0" IssueInstant="2016-03-08T17:00:12Z" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST">
   <saml:Issuer>me.com</saml:Issuer>
</samlp:AuthnRequest>

我回来的请求是这样的:

<?xml version="1.0" encoding="UTF-8"?>
<saml2:Assertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion" ID="_bff09cf745ea5722aac3f3ec57c0ecf3" IssueInstant="2016-03-08T17:01:06.140Z" Version="2.0">
    <saml2:Issuer ....
    <saml2:AttributeStatement>
        <saml2:Attribute FriendlyName="sn" Name="urn:oid:2.5.4.4" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
            <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">User</saml2:AttributeValue>
        </saml2:Attribute>
        <saml2:Attribute FriendlyName="givenName" Name="urn:oid:2.5.4.42" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:uri">
            <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Admin</saml2:AttributeValue>
        </saml2:Attribute>
    </saml2:AttributeStatement>
</saml2:Assertion>

我阅读了规范的相关部分,似乎说服务器可以返回它真正想要的任何东西(以及它想要多少属性)? 再次,我的问题是我是否可以强制 SAML Gluu/Shibboleth 服务器将特定属性作为 AuthnRequest 的一部分返回给我

【问题讨论】:

    标签: java saml saml-2.0 shibboleth gluu


    【解决方案1】:

    您需要在 IdP 上的信任关系中将所需属性添加到已发布的属性中。 Afaik 没有办法专门请求属性。

    【讨论】:

      【解决方案2】:

      只是为了提供更多细节,当您将元数据发送到 IdP 时,您需要像 SP 一样请求其他属性。该元数据描述了您的服务,包括 ACS 端点、您的 AuthnRequest 将用于签名的公共证书、您希望您的合作伙伴用来加密的证书、您需要的属性、您的唯一实体 ID 等。是一旦您确定了您的服务需要什么,这个元数据就不必改变 - 对于任何合作伙伴。您可以将其发送给您的合作伙伴。

      一旦您的合作伙伴收到此元数据,他们就会将其导入,并使用其身份存储库中的信息满足您请求的属性,配置签名和加密等。一切完成后,他们会将元数据发送给您,其中包含他们的协议端点(您需要向其中发送 AuthnRequest 等),可以验证其签名的证书,验证他们发送给您的属性(这些可以根据您应该与您的合作伙伴进行的对话而改变) 等。

      您获取此元数据,并将其导入您的系统,并根据需要建立与您的应用的连接。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-03-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2014-11-04
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多