Spring Security SAML 坚持在 SAML 身份验证请求中请求 Artifact 绑定(ProtocolBinding 属性):
<saml2p:AuthnRequest xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"
AssertionConsumerServiceURL="http://sp.com/saml/SSO/alias/defaultAlias"
Destination="https://idp.com/idp"
ForceAuthn="false"
ID="a4acj06d42fdc0d3494h859g3f7005c"
IsPassive="false"
IssueInstant="2012-12-05T17:07:18.271Z"
ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
Version="2.0"
>
如何配置 POST 绑定?
感谢您的任何答复!
——安德烈亚斯
谢谢诺比和桑吉夫,我最近将其应用于类似的案例,它让我走上了正轨。
作为 Spring Security SAML2 扩展的新手,我必须进行一些额外的挖掘才能应用 WebSSOProfileOptions。本质上,要在 SAML 身份验证请求上获得 HTTP-POST 绑定,您需要将配置文件选项传递给org.springframework.security.saml.websso.WebSSOProfileImpl#sendAuthenticationRequest()
method.
对于我们的配置,它与Spring RC2 示例项目中的配置 https://github.com/SpringSource/spring-security-saml/blob/master/saml2-sample/src/main/resources/security/securityContext.xml,这意味着通过WebSSOProfileOptions
bean 如 Sanjeev 的解决方案中所述samlEntryPoint.defaultProfileOptions
属性(或在那里添加绑定属性)。
问题是,这并没有导致 AuthnRequest 拾取所设置的绑定属性。在我们的例子中,我们的 SAML 元数据指定isDefault=true
在 HTTP-Artifact 绑定上AssertionConsumerService
。在我们的 Spring Security SAML2 库的 RC2 版本中,这是默认行为org.springframework.security.saml.metadata.MetadataGenerator
.
这可以通过设置来覆盖assertionConsumerIndex
MetadataGenerator 的属性。在我们的例子中,HTTP Post 断言使用者在索引 1 处配置。
<bean id="metadataGeneratorFilter" class="org.springframework.security.saml.metadata.MetadataGeneratorFilter">
<constructor-arg>
<bean class="org.springframework.security.saml.metadata.MetadataGenerator">
<property name="assertionConsumerIndex" value="1" /><!-- 1=HTTP-POST -->
</bean>
</constructor-arg>
</bean>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)