spring security saml:从数据库配置元数据url

vm0i2vca  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(393)

我和springsecurity saml有一个项目。这个想法来自本教程。
这是我添加元数据url的配置:

@Bean
    @Qualifier("azure-2")
    public ExtendedMetadataDelegate azure2ExtendedMetadataProvider() throws MetadataProviderException {
        HTTPMetadataProvider metadataProvider
                = new HTTPMetadataProvider(this.backgroundTaskTimer, httpClient(), metadataUrl2);
        metadataProvider.setParserPool(parserPool());
        metadataProvider.initialize();

        ExtendedMetadataDelegate extendedMetadataDelegate =
                new ExtendedMetadataDelegate(metadataProvider, extendedMetadata());
        extendedMetadataDelegate.setMetadataTrustCheck(true);
        extendedMetadataDelegate.setMetadataRequireSignature(false);

        backgroundTaskTimer.purge();
        return extendedMetadataDelegate;
    }

    // IDP Metadata configuration - paths to metadata of IDPs in circle of trust
    // is here
    // Do no forget to call initialize method on providers
    @Bean
    @Qualifier("metadata")
    public CachingMetadataManager metadata() throws MetadataProviderException, ResourceException {
        List<MetadataProvider> providers = new ArrayList<>();
        providers.add(azureExtendedMetadataProvider());
        providers.add(azure2ExtendedMetadataProvider());
        CachingMetadataManager metadataManager = new CachingMetadataManager(providers);
//        metadataManager.setDefaultIDP(defaultIdp);
        return metadataManager;
    }

如何从数据库动态加载元数据url?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题