本文整理汇总了Java中org.springframework.security.saml.context.SAMLContextProvider类的典型用法代码示例。如果您正苦于以下问题:Java SAMLContextProvider类的具体用法?Java SAMLContextProvider怎么用?Java SAMLContextProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SAMLContextProvider类属于org.springframework.security.saml.context包,在下文中一共展示了SAMLContextProvider类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: samlFilter
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
private FilterChainProxy samlFilter(SAMLEntryPoint samlEntryPoint, SAMLContextProvider contextProvider) {
List<SecurityFilterChain> chains = new ArrayList<>();
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"),
samlEntryPoint));
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
new MetadataDisplayFilter()));
try {
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
samlWebSSOProcessingFilter(samlAuthenticationProvider, contextProvider, samlProcessor)));
} catch (Exception e) {
e.printStackTrace();
}
SAMLDiscovery samlDiscovery = new SAMLDiscovery();
samlDiscovery.setMetadata(cachingMetadataManager);
samlDiscovery.setContextProvider(contextProvider);
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
samlDiscovery));
return new FilterChainProxy(chains);
}
开发者ID:spring-projects,项目名称:spring-security-saml-dsl,代码行数:20,代码来源:SAMLConfigurer.java
示例2: configure
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Override
public void configure(ServiceProviderBuilder builder) throws Exception {
SAMLContextProvider samlContextProviderBean = builder.getSharedObject(SAMLContextProvider.class);
if (samlContextProviderBean == null && !samlContextProviderProperties.getLb().isEnabled()) {
if (samlContextProvider == null) {
samlContextProvider = createDefaultSamlContextProvider();
}
builder.setSharedObject(SAMLContextProvider.class, samlContextProvider);
}
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:11,代码来源:SAMLContextProviderConfigurer.java
示例3: configure
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Override
public void configure(ServiceProviderBuilder builder) throws Exception {
SAMLContextProvider samlContextProviderBean = builder.getSharedObject(SAMLContextProvider.class);
if (samlContextProviderBean == null) {
if (samlContextProvider == null) {
samlContextProvider = createDefaultSamlContextProviderLB();
samlContextProvider.setScheme(Optional.ofNullable(scheme).orElseGet(config::getScheme));
samlContextProvider.setServerName(Optional.ofNullable(serverName).orElseGet(config::getServerName));
samlContextProvider.setIncludeServerPortInRequestURL(Optional.ofNullable(includeServerPortInRequestURL).orElseGet(config::getIncludeServerPortInRequestUrl));
samlContextProvider.setServerPort(Optional.ofNullable(serverPort).orElseGet(config::getServerPort));
samlContextProvider.setContextPath(Optional.ofNullable(contextPath).orElseGet(config::getContextPath));
}
builder.setSharedObject(SAMLContextProvider.class, samlContextProvider);
}
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:16,代码来源:SAMLContextProviderLBConfigurer.java
示例4: afterPropertiesSet
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Override
public void afterPropertiesSet() {
//All existing beans are thrown as shared objects to the ServiceProviderSecurityBuilder, which will wire all
//beans/objects related to spring security SAML.
serviceProviderBuilder.setSharedObject(ParserPool.class, ParserPoolHolder.getPool());
serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerImpl.class, (WebSSOProfileConsumerImpl) webSSOProfileConsumer);
serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerHoKImpl.class, hokWebSSOProfileConsumer);
serviceProviderBuilder.setSharedObject(ServiceProviderEndpoints.class, new ServiceProviderEndpoints());
serviceProviderBuilder.setSharedObject(ResourceLoader.class, resourceLoader);
serviceProviderBuilder.setSharedObject(SAMLSSOProperties.class, sAMLSsoProperties);
serviceProviderBuilder.setSharedObject(ExtendedMetadata.class, extendedMetadata);
serviceProviderBuilder.setSharedObject(LocalExtendedMetadata.class, localExtendedMetadata);
serviceProviderBuilder.setSharedObject(SAMLAuthenticationProvider.class, samlAuthenticationProvider);
serviceProviderBuilder.setSharedObject(SAMLContextProvider.class, samlContextProvider);
serviceProviderBuilder.setSharedObject(KeyManager.class, keyManager);
serviceProviderBuilder.setSharedObject(MetadataManager.class, metadataManager);
serviceProviderBuilder.setSharedObject(MetadataGenerator.class, metadataGenerator);
serviceProviderBuilder.setSharedObject(SAMLProcessor.class, samlProcessor);
serviceProviderBuilder.setSharedObject(WebSSOProfile.class, webSSOProfile);
serviceProviderBuilder.setSharedObject(WebSSOProfileECPImpl.class, ecpProfile);
serviceProviderBuilder.setSharedObject(WebSSOProfileHoKImpl.class, hokWebSSOProfile);
serviceProviderBuilder.setSharedObject(SingleLogoutProfile.class, sloProfile);
serviceProviderBuilder.setSharedObject(WebSSOProfileConsumer.class, webSSOProfileConsumer);
serviceProviderBuilder.setSharedObject(WebSSOProfileConsumerHoKImpl.class, hokWebSSOProfileConsumer);
serviceProviderBuilder.setSharedObject(SAMLLogger.class, samlLogger);
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:27,代码来源:SAMLServiceProviderSecurityConfiguration.java
示例5: configure
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Test
public void configure() throws Exception {
SAMLContextProviderConfigurer configurer = spy(new SAMLContextProviderConfigurer());
SAMLContextProvider provider = mock(SAMLContextProvider.class);
when(configurer.createDefaultSamlContextProvider()).thenReturn(provider);
configurer.init(builder);
configurer.configure(builder);
verify(builder).setSharedObject(eq(SAMLContextProvider.class), eq(provider));
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:10,代码来源:SAMLContextProviderConfigurerTest.java
示例6: configure_forBean
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Test
public void configure_forBean() throws Exception {
SAMLContextProviderConfigurer configurer = spy(new SAMLContextProviderConfigurer());
SAMLContextProvider provider = mock(SAMLContextProvider.class);
when(builder.getSharedObject(SAMLContextProvider.class)).thenReturn(provider);
configurer.init(builder);
configurer.configure(builder);
verify(configurer, never()).createDefaultSamlContextProvider();
verify(builder, never()).setSharedObject(any(), any());
verifyZeroInteractions( provider);
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:12,代码来源:SAMLContextProviderConfigurerTest.java
示例7: configure_forConstructor
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Test
public void configure_forConstructor() throws Exception {
SAMLContextProvider provider = mock(SAMLContextProvider.class);
SAMLContextProviderConfigurer configurer = spy(new SAMLContextProviderConfigurer(provider));
configurer.init(builder);
configurer.configure(builder);
verify(configurer, never()).createDefaultSamlContextProvider();
verify(builder).setSharedObject(SAMLContextProvider.class, provider);
verifyZeroInteractions( provider);
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:11,代码来源:SAMLContextProviderConfigurerTest.java
示例8: init
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@Override
public void init(HttpSecurity http) {
metadataProvider = identityProvider.metadataProvider();
ExtendedMetadata extendedMetadata = extendedMetadata(identityProvider.discoveryEnabled);
extendedMetadataDelegate = extendedMetadataDelegate(extendedMetadata);
serviceProvider.keyManager = serviceProvider.keyManager();
cachingMetadataManager = cachingMetadataManager();
webSSOProfile = new WebSSOProfileImpl(samlProcessor, cachingMetadataManager);
samlAuthenticationProvider = samlAuthenticationProvider(webSSOProfileConsumer);
bootstrap();
SAMLContextProvider contextProvider = contextProvider();
SAMLEntryPoint samlEntryPoint = samlEntryPoint(contextProvider);
try {
http
.httpBasic()
.authenticationEntryPoint(samlEntryPoint);
CsrfConfigurer<HttpSecurity> csrfConfigurer = http.getConfigurer(CsrfConfigurer.class);
if(csrfConfigurer != null) {
// Workaround to get working with Spring Security 3.2.
RequestMatcher ignored = new AntPathRequestMatcher("/saml/SSO");
RequestMatcher notIgnored = new NegatedRequestMatcher(ignored);
RequestMatcher matcher = new AndRequestMatcher(new DefaultRequiresCsrfMatcher(), notIgnored);
csrfConfigurer.requireCsrfProtectionMatcher(matcher);
}
} catch (Exception e) {
e.printStackTrace();
}
http
.addFilterBefore(metadataGeneratorFilter(samlEntryPoint, extendedMetadata), ChannelProcessingFilter.class)
.addFilterAfter(samlFilter(samlEntryPoint, contextProvider), BasicAuthenticationFilter.class)
.authenticationProvider(samlAuthenticationProvider);
}
开发者ID:spring-projects,项目名称:spring-security-saml-dsl,代码行数:40,代码来源:SAMLConfigurer.java
示例9: createDefaultSamlContextProvider
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
@VisibleForTesting
protected SAMLContextProvider createDefaultSamlContextProvider() {
return new SAMLContextProviderImpl();
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:5,代码来源:SAMLContextProviderConfigurer.java
示例10: SAMLContextProviderConfigurer
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
public SAMLContextProviderConfigurer(SAMLContextProvider samlContextProvider) {
this.samlContextProvider = samlContextProvider;
}
开发者ID:ulisesbocchio,项目名称:spring-boot-security-saml,代码行数:5,代码来源:SAMLContextProviderConfigurer.java
示例11: setContextProvider
import org.springframework.security.saml.context.SAMLContextProvider; //导入依赖的package包/类
/**
* Sets entity responsible for populating local entity context data.
* It is set in the custom config, so can be optional here.
* User could override it if desired.
*
* @param contextProvider provider implementation
*/
@Autowired(required = false)
@Override
public void setContextProvider(SAMLContextProvider contextProvider) {
super.setContextProvider(contextProvider);
}
开发者ID:spring-projects,项目名称:spring-security-saml-dsl,代码行数:13,代码来源:SAMLDslEntryPoint.java
注:本文中的org.springframework.security.saml.context.SAMLContextProvider类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论