【问题标题】:Spring Security SAML extension with OPENAM带有 OPENAM 的 Spring Security SAML 扩展
【发布时间】:2013-03-02 01:30:38
【问题描述】:

所以这里是场景。

我有我的网络应用程序 IDP 代理 IDP。 IDP 代理和 IDP 都是 openam 实例。 我们的想法是我们可以添加额外的 IDP(来自其他客户端),因此我们需要一个代理来屏蔽复杂性。

所以这里的 IDP 代理是:http://idpproxydev.devs1.int:8080/openam

IDP 网址为:http://idpdev.devs1.int:80/openam

我的网络应用是:http://ocr-jq0zt91.devs1.int:9081/LOS

我开始使用 http://static.springsource.org/spring-security/site/extensions/saml/index.html 用于集成,现在我看到 SAML: request wassent from my web app 。

我现在遇到的问题是,当我使用 Fedlet(在 IDP 代理上使用 Openam 生成的客户端)测试我的设置时,请求转到代理,然后路由到 IDP,因为 Fedlet 生成的 SAML 请求具有额外的信息,即 SAML 请求中的这个 sn-p

<samlp:Scoping xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"  ProxyCount="1"   >
       <samlp:IDPList xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
        <samlp:IDPEntry xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol"
                        ProviderID="http://idpdev.devs1.int:80/openam"  />
    </samlp:IDPList>
</samlp:Scoping>

所以我看到的唯一区别是 FEDLET 生成的 SAML 请求中的额外负载。

因此,通过在 SAML 请求中看到上面的 sn-p,IDP 代理知道最终目的地不是它自己(http://idpproxydev.devs1.int:8080/openam),而是另一个实体,在这种情况下是 http://idpdev.devs1.int:80/openam

Fedlet 有用于扩展元数据的附加属性文件 (sp-extended.xml),我们可以在其中添加这些附加内容。

<Attribute name="enableIDPProxy">
           <Value>true</Value>
       </Attribute>
       <Attribute name="idpProxyList">
           <Value> http://idpdev.devs1.int:80/openam</Value>  (the attribute name is little confusing as this is the IDP)
       </Attribute>
       <Attribute name="idpProxyCount">
           <Value>1</Value>
       </Attribute>

但是在 spring saml 安全库中,我看不到任何可以添加这些附加属性的方式,以便 SAML 请求可以包含此信息。 有没有办法提供上面列出的其他属性?

这样当我的网络应用发送请求时 spring saml 扩展可以读取?

【问题讨论】:

    标签: spring security saml openam spring-saml


    【解决方案1】:

    我找到了解决此问题的方法。 你需要使用 org.springframework.security.saml.websso.WebSSOProfileOptions

    这是我的网络应用程序中的一个示例。将此添加到您的 security.xml 中

    <beans:bean id="samlEntryPoint" class="org.springframework.security.saml.SAMLEntryPoint">
            <beans:property name="defaultProfileOptions">
                <beans:bean class="org.springframework.security.saml.websso.WebSSOProfileOptions">
                    <beans:property name="binding" value="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"/>
                    <beans:property name="includeScoping" value="true"/>
                    <!-- to skip proxyCount, 0 to disable proxying, >0 to allow proxying-->
                    <beans:property name="proxyCount" value="1"/>
                    <beans:property name="allowedIDPs">
                        <beans:set>
         <beans:value>http://idpproxydev.devs1.int:80/openam</beans:value>                  
                        </beans:set>
                   </beans:property>        
      <!--  Allowed Values are in  AuthnContextComparison.java -->
                <beans:property name="authnContextComparison" value="EXACT"/>
                <beans:property name="authnContexts">
                        <beans:list>
     <beans:value>
    urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport
    </beans:value>                  
                        </beans:list>
                </beans:property>
                <beans:property name="nameID" value="urn:oasis:names:tc:SAML:2.0:nameid-  format:transient"/>
                <beans:property name="allowCreate" value="true"/>
                    </beans:bean>
            </beans:property>
        </beans:bean>
    

    现在我看到来自 WEB 应用程序的 SAML 请求具有 IDP 列表。

    还添加了一些额外的注释,以使用 SPRING SAML 扩展将 JSF Web 应用程序与 openam 集成。

    请参阅我关于与 Openam 概念相关的一般信息的文章 http://reddymails.blogspot.com/2013/03/sso-for-java-or-net-web-based.html

    使用 Spring SAML 扩展和 Spring Security 将 JSF 2 Web 应用程序与 Openam 集成的步骤。 http://reddymails.blogspot.com/2013/06/integrating-jsf-web-applicataion-with.html

    -拉玛

    【讨论】:

      猜你喜欢
      • 2015-08-27
      • 2020-05-31
      • 2015-07-30
      • 2013-07-12
      • 2015-02-28
      • 1970-01-01
      • 2014-10-14
      • 2017-05-23
      • 2015-05-19
      相关资源
      最近更新 更多