本文整理汇总了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);
}
示例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;
}
示例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());
}
示例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);
}
示例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();
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}