SAML服务提供商的弹簧安全性 [英] SAML service provider spring security

查看:136
本文介绍了SAML服务提供商的弹簧安全性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用预先配置的服务提供程序元数据时,在spring安全性中,是否应该有2个bean定义用于扩展元数据委托?一个用于IDP元数据,一个用于SP元数据?

When using pre-configured service provider metadata, in spring security, should there be 2 beans definitions for extended metadata delegate ? one for IDP metadata, and one for SP metadata ?

<bean class="org.springframework.security.saml.metadata.ExtendedMetadataDelegate">
    <constructor-arg>
        <bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
            <constructor-arg>
                <value type="java.io.File">classpath:security/localhost_sp.xml</value>
            </constructor-arg>
            <property name="parserPool" ref="parserPool"/>
        </bean>
    </constructor-arg>
    <constructor-arg>
        <bean class="org.springframework.security.saml.metadata.ExtendedMetadata">
           <property name="local" value="true"/>
           <property name="alias" value="default"/>
           <property name="securityProfile" value="metaiop"/>
           <property name="sslSecurityProfile" value="pkix"/>
           <property name="signingKey" value="apollo"/>
           <property name="encryptionKey" value="apollo"/>
           <property name="requireArtifactResolveSigned" value="false"/>
           <property name="requireLogoutRequestSigned" value="false"/>
           <property name="requireLogoutResponseSigned" value="false"/>
           <property name="idpDiscoveryEnabled" value="true"/>
           <property name="idpDiscoveryURL"
              value="https://www.server.com:8080/context/saml/discovery/alias/default"/>
           <property name="idpDiscoveryResponseURL"
              value="https://www.server.com:8080/context/saml/login/alias/default?disco=true"/>
        </bean>
    </constructor-arg>
</bean>




<bean class="org.springframework.security.saml.metadata.ExtendedMetadataDelegate">
    <constructor-arg>
        <bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
            <constructor-arg>
                <value type="java.io.File">classpath:security/idp.xml</value>
            </constructor-arg>
            <property name="parserPool" ref="parserPool"/>
        </bean>
    </constructor-arg>
    <constructor-arg>
        <bean class="org.springframework.security.saml.metadata.ExtendedMetadata"/>
    </constructor-arg>
</bean>


推荐答案

找到我的问题的答案....定位它在这里以防其他人寻找相同的。

Found the answer to my question....positing it here in case someone else looking for the same.

     <bean id="metadata" class="org.springframework.security.saml.metadata.CachingMetadataManager">
        <constructor-arg>
            <list>

            <bean class="org.springframework.security.saml.metadata.ExtendedMetadataDelegate">
                <constructor-arg>
                    <bean class="org.opensaml.saml2.metadata.provider.HTTPMetadataProvider">
                        <constructor-arg>

                        <value type="java.lang.String">http://idp.ssocircle.com/idp-meta.xml</value>

                        </constructor-arg>
                        <constructor-arg>
                            <!-- Timeout for metadata loading in ms -->
                            <value type="int">5000</value>
                        </constructor-arg>
                        <property name="parserPool" ref="parserPool"/>
                    </bean>
                </constructor-arg>
                <constructor-arg>
                    <bean class="org.springframework.security.saml.metadata.ExtendedMetadata"/>
                </constructor-arg>
                <property name="metadataTrustCheck"  value="false"/>
            </bean>

            <bean class="org.springframework.security.saml.metadata.ExtendedMetadataDelegate">

            <constructor-arg>
                    <bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
                        <constructor-arg>
                            <value type="java.io.File">file:///C:/SP_Metadata.xml</value>
                        </constructor-arg>
                        <property name="parserPool" ref="parserPool"/>
                    </bean>
                </constructor-arg>
                <constructor-arg>
                           <bean class="org.springframework.security.saml.metadata.ExtendedMetadata">
                       <property name="local" value="true"/>
                       <property name="alias" value="defaultAlias"/>
                       <property name="securityProfile" value="metaiop"/>
                       <property name="sslSecurityProfile" value="pkix"/>
                       <property name="signingKey" value="apollo"/>
                       <property name="encryptionKey" value="apollo"/>
                       <property name="requireArtifactResolveSigned" value="true"/>
                       <property name="requireLogoutRequestSigned" value="true"/>
                       <property name="requireLogoutResponseSigned" value="false"/>
                       <property name="idpDiscoveryEnabled" value="true"/>
                       <property name="idpDiscoveryURL" value="https://localhost/mywebapp-SNAPSHOT/saml/discovery/alias/defaultAlias"/>
                       <property name="idpDiscoveryResponseURL" value="https://localhost/mywebapp-SNAPSHOT/saml/login/alias/defaultAlias?disco=true"/>
                    </bean>
                </constructor-arg>
            </bean>
            </list>
        </constructor-arg>
<!-- my SP_metadata had this as the entity id -->
        <property name="hostedSPName" value="urn:test:myapp:auth"/> 
<!-- my idp metadata points to the sso circle idp -->
          <property name="defaultIDP" value="http://idp.ssocircle.com"/> 
    </bean>

这篇关于SAML服务提供商的弹簧安全性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆