当前位置: 首页>>代码示例>>Java>>正文


Java ResourceBackedMetadataProvider类代码示例

本文整理汇总了Java中org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider的典型用法代码示例。如果您正苦于以下问题:Java ResourceBackedMetadataProvider类的具体用法?Java ResourceBackedMetadataProvider怎么用?Java ResourceBackedMetadataProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ResourceBackedMetadataProvider类属于org.opensaml.saml2.metadata.provider包,在下文中一共展示了ResourceBackedMetadataProvider类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: configure_constructor

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_constructor() throws Exception {
    MetadataManager metadataManager = mock(MetadataManager.class);
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer(metadataManager));
    configurer.setBuilder(builder);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer).createDefaultMetadataProvider(eq(idpConfiguration.getMetadataLocation()));
    verify(configurer).createDefaultExtendedMetadataDelegate(any(ResourceBackedMetadataProvider.class), any());
    verify(metadataManagerProperties, never()).getDefaultIdp();
    verify(metadataManagerProperties, never()).getHostedSpName();
    verify(metadataManagerProperties, never()).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isExactlyInstanceOf(ExtendedMetadataDelegate.class);
    assertThat(((ExtendedMetadataDelegate) providers.get(0)).getDelegate()).isExactlyInstanceOf(ResourceBackedMetadataProvider.class);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:26,代码来源:MetadataManagerConfigurerTest.java

示例2: getEntityDescriptor

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
/**
 * @param entityId
 * @param resource
 * @return
 * @throws MetadataProviderException
 */
private EntityDescriptor getEntityDescriptor(String entityId, ClasspathResource resource) throws MetadataProviderException {
	AbstractReloadingMetadataProvider abstractReloadingMetadataProvider = new ResourceBackedMetadataProvider(new Timer(), resource);
	BasicParserPool parser = new BasicParserPool();
	parser.setNamespaceAware(true);
	abstractReloadingMetadataProvider.setParserPool(parser);
	abstractReloadingMetadataProvider.initialize();
	EntityDescriptor entityDescriptor = abstractReloadingMetadataProvider.getEntityDescriptor(entityId);
	return entityDescriptor;
}
 
开发者ID:italia,项目名称:spid-spring,代码行数:16,代码来源:AuthenticationInfoExtractor.java

示例3: configure_defaults

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_defaults() throws Exception {
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer());
    CachingMetadataManager metadataManager = mock(CachingMetadataManager.class);
    when(configurer.createDefaultMetadataManager()).thenReturn(metadataManager);
    ExtendedMetadataDelegate delegate = mock(ExtendedMetadataDelegate.class);
    doReturn(delegate).when(configurer).createDefaultExtendedMetadataDelegate(any(), any());
    configurer.setBuilder(builder);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer).createDefaultMetadataProvider(eq(idpConfiguration.getMetadataLocation()));
    verify(configurer).createDefaultExtendedMetadataDelegate(any(ResourceBackedMetadataProvider.class), any());
    verify(metadataManagerProperties).getDefaultIdp();
    verify(metadataManagerProperties).getHostedSpName();
    verify(metadataManagerProperties).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isEqualTo(delegate);
    verify(metadataManager).setDefaultIDP(eq(metadataManagerProperties.getDefaultIdp()));
    verify(metadataManager).setHostedSPName(eq(metadataManagerProperties.getHostedSpName()));
    verify(metadataManager).setRefreshCheckInterval(eq(metadataManagerProperties.getRefreshCheckInterval()));
    verify(delegate).setForceMetadataRevocationCheck(eq(extendedMetadataDelegateProperties.isForceMetadataRevocationCheck()));
    verify(delegate).setMetadataRequireSignature(eq(extendedMetadataDelegateProperties.isMetadataRequireSignature()));
    verify(delegate).setMetadataTrustCheck(eq(extendedMetadataDelegateProperties.isMetadataTrustCheck()));
    verify(delegate).setMetadataTrustedKeys(eq(extendedMetadataDelegateProperties.getMetadataTrustedKeys()));
    verify(delegate).setRequireValidMetadata(eq(extendedMetadataDelegateProperties.isRequireValidMetadata()));
    verify(delegate).setMetadataFilter((MetadataFilter) isNull());
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:37,代码来源:MetadataManagerConfigurerTest.java

示例4: configure_defaults_withProvider

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_defaults_withProvider() throws Exception {
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer());
    CachingMetadataManager metadataManager = mock(CachingMetadataManager.class);
    when(configurer.createDefaultMetadataManager()).thenReturn(metadataManager);
    configurer.setBuilder(builder);
    AbstractMetadataProvider provider = mock(AbstractMetadataProvider.class);
    configurer.metadataProvider(provider);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(provider).setParserPool(eq(parserPool));
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer, never()).createDefaultMetadataProvider(eq(idpConfiguration.getMetadataLocation()));
    verify(configurer).createDefaultExtendedMetadataDelegate(any(ResourceBackedMetadataProvider.class), any());
    verify(metadataManagerProperties).getDefaultIdp();
    verify(metadataManagerProperties).getHostedSpName();
    verify(metadataManagerProperties).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isExactlyInstanceOf(ExtendedMetadataDelegate.class);
    assertThat(((ExtendedMetadataDelegate) providers.get(0)).getDelegate()).isEqualTo(provider);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:30,代码来源:MetadataManagerConfigurerTest.java

示例5: configure_defaults_withProviderDelegate

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_defaults_withProviderDelegate() throws Exception {
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer());
    CachingMetadataManager metadataManager = mock(CachingMetadataManager.class);
    when(configurer.createDefaultMetadataManager()).thenReturn(metadataManager);
    configurer.setBuilder(builder);
    MetadataProvider provider = mock(ExtendedMetadataDelegate.class);
    configurer.metadataProvider(provider);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer, never()).createDefaultMetadataProvider(eq(idpConfiguration.getMetadataLocation()));
    verify(configurer, never()).createDefaultExtendedMetadataDelegate(any(ResourceBackedMetadataProvider.class), any());
    verify(metadataManagerProperties).getDefaultIdp();
    verify(metadataManagerProperties).getHostedSpName();
    verify(metadataManagerProperties).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties, never()).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties, never()).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties, never()).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties, never()).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties, never()).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isEqualTo(provider);
    assertThat(((ExtendedMetadataDelegate) providers.get(0)).getDelegate()).isNull();
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:29,代码来源:MetadataManagerConfigurerTest.java

示例6: configure_defaults_withProviderLocation

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_defaults_withProviderLocation() throws Exception {
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer());
    CachingMetadataManager metadataManager = mock(CachingMetadataManager.class);
    when(configurer.createDefaultMetadataManager()).thenReturn(metadataManager);
    configurer.setBuilder(builder);
    configurer.metadataLocations("classpath:idp-provided.xml");
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer).createDefaultMetadataProvider(eq("classpath:idp-provided.xml"));
    verify(configurer).createDefaultExtendedMetadataDelegate(any(ResourceBackedMetadataProvider.class), any());
    verify(metadataManagerProperties).getDefaultIdp();
    verify(metadataManagerProperties).getHostedSpName();
    verify(metadataManagerProperties).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isExactlyInstanceOf(ExtendedMetadataDelegate.class);
    assertThat(((ExtendedMetadataDelegate) providers.get(0)).getDelegate()).isExactlyInstanceOf(ResourceBackedMetadataProvider.class);
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:28,代码来源:MetadataManagerConfigurerTest.java

示例7: extendedMetadataProvider

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
public ExtendedMetadataDelegate extendedMetadataProvider()
		throws Exception {	
	ResourceBackedMetadataProvider metadataProvider 
        = new ResourceBackedMetadataProvider(new Timer(),
            new ClasspathResource(properties.getIdpMetaFile()));
	metadataProvider.setParserPool(parserPool());
	ExtendedMetadataDelegate extendedMetadataDelegate =
        new ExtendedMetadataDelegate(metadataProvider, extendedMetadata());
	extendedMetadataDelegate.setMetadataTrustCheck(false);
	extendedMetadataDelegate.setMetadataRequireSignature(false);
	return extendedMetadataDelegate;
}
 
开发者ID:takesection,项目名称:spring-boot-saml2,代码行数:13,代码来源:WebSecurityConfig.java

示例8: ssoCircleExtendedMetadataProvider

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Bean
@Qualifier("idp-ssocircle")
public ExtendedMetadataDelegate ssoCircleExtendedMetadataProvider()
        throws MetadataProviderException, ResourceException {
    ClasspathResource idpMetadataResource = new ClasspathResource("/saml/ssocircle-idp-metadata.xml");
    ResourceBackedMetadataProvider metadataProvider =
            new ResourceBackedMetadataProvider(new Timer(), idpMetadataResource);
    metadataProvider.setParserPool(parserPool());
    ExtendedMetadataDelegate extendedMetadataDelegate =
            new ExtendedMetadataDelegate(metadataProvider, extendedMetadata());
    extendedMetadataDelegate.setMetadataTrustCheck(false);
    extendedMetadataDelegate.setMetadataRequireSignature(false);
    return extendedMetadataDelegate;
}
 
开发者ID:chrludwig,项目名称:websec-saml2sp,代码行数:15,代码来源:SamlSpringSecurityConfig.java

示例9: wso2IsExtendedMetadataProvider

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Bean
@Qualifier("idp-wso2-is")
public ExtendedMetadataDelegate wso2IsExtendedMetadataProvider()
        throws MetadataProviderException, ResourceException {
    ClasspathResource idpMetadataResource = new ClasspathResource("/saml/wso2-is-localhost-idp-metadata.xml");
    ResourceBackedMetadataProvider metadataProvider =
            new ResourceBackedMetadataProvider(new Timer(), idpMetadataResource);
    metadataProvider.setParserPool(parserPool());
    ExtendedMetadataDelegate extendedMetadataDelegate =
            new ExtendedMetadataDelegate(metadataProvider, extendedMetadata());
    extendedMetadataDelegate.setMetadataTrustCheck(false);
    extendedMetadataDelegate.setMetadataRequireSignature(false);
    return extendedMetadataDelegate;
}
 
开发者ID:chrludwig,项目名称:websec-saml2sp,代码行数:15,代码来源:SamlSpringSecurityConfig.java

示例10: idpMetaDataDelegate

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Bean
public ExtendedMetadataDelegate idpMetaDataDelegate() throws MetadataProviderException, ResourceException {

    ResourceBackedMetadataProvider metadataProvider = idpMetadataProvider();

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

    return extendedMetadataDelegate;
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:13,代码来源:WebSecurityConfig.java

示例11: idpMetadataProvider

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Bean
public ResourceBackedMetadataProvider idpMetadataProvider() throws MetadataProviderException, ResourceException {
    ResourceBackedMetadataProvider metadataProvider = new ResourceBackedMetadataProvider(new Timer(), new FilesystemResource(environment.getProperty("saml.idp.metadata.location")));
    metadataProvider.setFailFastInitialization(false);
    metadataProvider.setParserPool(parserPool());
    return metadataProvider;
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:8,代码来源:WebSecurityConfig.java

示例12: configure_arguments

import org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider; //导入依赖的package包/类
@Test
public void configure_arguments() throws Exception {
    MetadataManagerConfigurer configurer = spy(new MetadataManagerConfigurer());
    CachingMetadataManager metadataManager = mock(CachingMetadataManager.class);
    when(configurer.createDefaultMetadataManager()).thenReturn(metadataManager);
    ResourceBackedMetadataProvider provider = mock(ResourceBackedMetadataProvider.class);
    doReturn(provider).when(configurer).createDefaultMetadataProvider("classpath:idp-provided.xml");
    ExtendedMetadataDelegate delegate = mock(ExtendedMetadataDelegate.class);
    doReturn(delegate).when(configurer).createDefaultExtendedMetadataDelegate(eq(provider), any(ExtendedMetadata.class));
    MetadataFilter metadataFilter = mock(MetadataFilter.class);
    configurer.setBuilder(builder);
    configurer
            .metadataLocations("classpath:idp-provided.xml")
            .defaultIDP("default")
            .hostedSPName("spname")
            .refreshCheckInterval(999L)
            .forceMetadataRevocationCheck(true)
            .metadataRequireSignature(true)
            .metadataTrustCheck(true)
            .requireValidMetadata(true)
            .metadataTrustedKeys("one", "two")
            .metadataFilter(metadataFilter);
    configurer.init(builder);
    configurer.configure(builder);
    verify(builder).setSharedObject(eq(MetadataManager.class), eq(metadataManager));
    ArgumentCaptor<List> providersCaptor = ArgumentCaptor.forClass(List.class);
    verify(metadataManager).setProviders((List<MetadataProvider>) providersCaptor.capture());
    verify(configurer).createDefaultMetadataProvider(eq("classpath:idp-provided.xml"));
    verify(configurer).createDefaultExtendedMetadataDelegate(eq(provider), any());
    verify(metadataManagerProperties, never()).getDefaultIdp();
    verify(metadataManagerProperties, never()).getHostedSpName();
    verify(metadataManagerProperties, never()).getRefreshCheckInterval();
    verify(extendedMetadataDelegateProperties, never()).isForceMetadataRevocationCheck();
    verify(extendedMetadataDelegateProperties, never()).isMetadataRequireSignature();
    verify(extendedMetadataDelegateProperties, never()).isMetadataTrustCheck();
    verify(extendedMetadataDelegateProperties, never()).isRequireValidMetadata();
    verify(extendedMetadataDelegateProperties, never()).getMetadataTrustedKeys();
    List<MetadataProvider> providers = providersCaptor.getValue();
    assertThat(providers).hasSize(1);
    assertThat(providers.get(0)).isEqualTo(delegate);
    verify(metadataManager).setDefaultIDP(eq("default"));
    verify(metadataManager).setHostedSPName(eq("spname"));
    verify(metadataManager).setRefreshCheckInterval(eq(999L));
    verify(delegate).setForceMetadataRevocationCheck(eq(true));
    verify(delegate).setMetadataRequireSignature(eq(true));
    verify(delegate).setMetadataTrustCheck(eq(true));
    verify(delegate).setMetadataTrustedKeys((Set<String>) argThat(contains("one", "two")));
    verify(delegate).setRequireValidMetadata(eq(true));
    verify(delegate).setMetadataFilter(eq(metadataFilter));
}
 
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:51,代码来源:MetadataManagerConfigurerTest.java


注:本文中的org.opensaml.saml2.metadata.provider.ResourceBackedMetadataProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。