微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Java SpringMVC SAML 库在生成服务元数据时引发 IllegalArgumentException:“未找到名称为 MetadataKeyInfoGenerator 的管理器”

如何解决Java SpringMVC SAML 库在生成服务元数据时引发 IllegalArgumentException:“未找到名称为 MetadataKeyInfoGenerator 的管理器”

我正在尝试在 Java SpringMVC 框架中设置 SAML。 基本上,每当我尝试访问服务提供商 (http://baseaddress/context/saml/Metadata) 或触发单点登录(应该重定向到身份提供商)时,我都会收到异常:java.lang.IllegalArgumentException: Manager with name 'MetadataKeyInfoGenerator' does not exist。如果我使用 ResourceBackedMetadataProvider,它会起作用。

<!-- IDP Metadata configuration - paths to Metadata of IDPs in circle of trust is here -->
<bean id="Metadata" class="org.springframework.security.saml.Metadata.CachingMetadataManager">
    <constructor-arg>
        <list>      
            <bean class="org.springframework.security.saml.Metadata.ExtendedMetadataDelegate">
                <property name="MetadataTrustCheck" value="false" />
                <property name="MetadataRequireSignature" value ="false" />
                <constructor-arg>
                    <bean class="org.opensaml.saml2.Metadata.provider.HTTPMetadataProvider">
                        <constructor-arg>
                            <value type="java.lang.String">http://localhost:8088/Metadata</value>
                        </constructor-arg>
                        <constructor-arg>
                            <value type="int">15000</value>
                        </constructor-arg>
                        <property name="parserPool" ref="parserPool"/>
                    </bean>
                </constructor-arg>
                    <constructor-arg>
                        <bean class="org.springframework.security.saml.Metadata.ExtendedMetadata"/>
                    </constructor-arg>
            </bean> 
        </list>
    </constructor-arg>
    <!-- OPTIONAL used when one of the Metadata files contains information about this service provider -->
    <!-- <property name="hostedSPName" value=""/> -->
    <!-- OPTIONAL property: can tell the system which IDP should be used for authenticating user by default. -->
    <!-- <property name="defaultIDP" value="http://localhost:8080/opensso"/> -->
</bean>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。