7

我一直在尝试使用 opensaml-java 生成 SAML 对象。

参考:幻灯片 #30 在https://www.oasis-open.org/committees/download.php/12958/SAMLV2.0-basics.pdf

<samlp:AuthnRequest xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                        ForceAuthn="true"
                        AssertionConsumerServiceURL="http://www.example.com/"
                        AttributeConsumingServiceIndex="0" ProviderName="string"
                        ID="abe567de6"
                        Version="2.0"
                        IssueInstant="2005-01-31T12:00:00Z"
                        Destination="http://www.example.com/"
                        Consent="http://www.example.com/" >

在这个 Destination 中, Consent , AssertionConsumerServiceURL 三者都代表同一个地址。 他们实际上代表什么?

[Q.1]它们之间有什么区别吗? 肯定有一些区别,否则他们不会拥有这三样东西。

或者如果没有区别,它们代表什么?

编辑 1:AssertionConsumerServiceURL 是 IdP 的登录页面,预计来自 IdP 的断言响应消息。

4

2 回答 2

9

Destination (defined in saml 2 core lines 1477-1482)

Destination is URL of the endpoint you are sending the message to. Typically SAML peers have different endpoints for different bindings and the value is used at IDP to verify that the received message was actually intended for the place where it was received. It helps mitigate certain attack scenarios.

Consent (defined in saml 2 core lines 1483-1488)

Value is just an advice to IDP telling about the way sender received permission from the principal (typically user) to issue this SAML message on her behalf. It's optional and typically unused.

AssertionConsumerServiceURL (defined in saml 2 core lines 2061-2067)

Identifies URL at your side, where peer IDP must send the response to. When you use this attribute you should also specify ProtocolBinding. The value is mutually exclusive with assertionConsumerServiceIndex, so you shouldn't use both at the same time.

于 2014-04-27T10:01:28.570 回答
7

SAML 规范定义了三个角色:主体(通常是用户)、身份提供者 (IdP) 和服务提供者 (SP)。 维基

服务提供者请求(SAML 请求)并从身份提供者获得身份断言(SAML 响应)

所以AssertionConsumerServiceURL位于服务提供者 (SP) 端。在这个 URL 上,身份提供者 (IdP) 将发送包含断言的 SAML 响应,并且服务提供者 (SP) 应该具有读取它的设施。

据我了解,绑定表示 SAML XML 协议消息将在 SP 和 IdP 之间传输(到标准消息格式)的方式。有不止1种方式。例如

  • HTTP 发布,
  • HTTP 重定向
  • SAML SOAP 绑定(基于 SOAP 1.1)

因此 SP 可能有多个绑定 URL 地址,即

  • 断言消费者服务 POST 绑定 URL
  • 断言消费者服务重定向绑定 URL
于 2016-10-23T00:00:35.117 回答