简体   繁体   English

AuthnRequest中的SAML请求属性

[英]SAML Request Attributes In AuthnRequest

I kind of understand how basic SAML authentication supposed to work: 我有点理解基本的SAML身份验证应该如何工作:

User request resource at SP SP的用户请求资源
SP sends auth request to IDP SP向IDP发送身份验证请求
IDP authenticates user and sends back some userId IDP对用户进行身份验证并发回一些userId
SP sends attribute query to IDP for additional details with userId SP使用userId向IDP发送属性查询以获取其他详细信息
IDP sends back attributes IDP发回属性
SP gives user resource SP提供用户资源

My issue is, can you any way bypass AttributeQuery. 我的问题是,你能绕过AttributeQuery吗? When I make a SAML 2.0 request to my testing Gluu/Shibboleth server, I get back givenName (firstname) and sn (lastname). 当我向我的测试Gluu / Shibboleth服务器发出SAML 2.0请求时,我得到了givenName (firstname)和sn (lastname)。 Is there anyway I can request inum user id and email in just the AuthnRequest? 无论如何我可以在AuthnRequest中请求inum用户ID和电子邮件吗?

My request is pretty simple: 我的要求非常简单:

<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>

Request I get back is something like this: 请求我回来是这样的:

<?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>

I read the relevant part of the spec, and it seems to say the server can give back whatever it wants really (and how many attributes it wants)? 我阅读了规范的相关部分,似乎说服务器可以回馈它想要的任何东西(以及它想要多少属性)? Again, my question is whether I can force the SAML Gluu/Shibboleth server to give me back specific attributes as part of AuthnRequest . 同样,我的问题是我是否可以强制SAML Gluu / Shibboleth服务器将特定属性作为AuthnRequest的一部分返回给我

You need to add the wanted attributes to the released attributes in your Trust Relationship on the IdP. 您需要将所需属性添加到IdP上的信任关系中的已发布属性。 Afaik there's no way to specifically request attributes. Afaik没有办法专门请求属性。

Just to provide a bit more detail, the time for you to request additional attributes as the SP is when you send your metadata to the IdP. 只是为了提供更多详细信息,您可以在将元数据发送到IdP时请求SP的其他属性。 That metadata describes your service, to include the ACS endpoint, the public certificate that your AuthnRequests will be signed with, the certificate that you want your partner to encrypt with, the attributes that you require, your unique entity ID, etc. The nice thing is that once you determine what your service needs, this metadata doesn't have to change - for ANY partner. 该元数据描述了您的服务,包括ACS端点,您的AuthnRequests将使用的公共证书,您希望合作伙伴加密的证书,您需要的属性,您的唯一实体ID等。一旦你确定了你的服务需求,这个元数据就不必改变 - 对于任何合作伙伴。 You can send it to everyone you partner with. 您可以将它发送给您合作的每个人。

Once your partner receives this metadata, they import it, and fulfill the attributes you requested with information out of their identity repository, configure the signing and encryption, etc. Once everything is done they send their metadata to you, which contains their protocol endpoints (where you need to send AuthnRequests, etc., to), the certificate that can validate their signing, validation of the attributes that they are sending to you (these can change, based on conversations that you should be holding with your partner) etc. 一旦您的合作伙伴收到此元数据,他们就会导入该元数据,并使用其身份存储库中的信息来满足您请求的属性,配置签名和加密等。一切完成后,他们会将元数据发送给您,其中包含其协议端点(您需要在哪里发送AuthnRequests等),证书可以验证他们的签名,验证他们发送给您的属性(这些可以根据您与合作伙伴应该持有的对话进行更改)等。

You get this metadata, and import it into your system, and build out the connection(s) to your apps as needed. 您将获得此元数据,并将其导入您的系统,并根据需要构建与您的应用程序的连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM