use of org.springframework.security.web.SecurityFilterChain in project midpoint by Evolveum.
the class LdapModuleFactory method createModuleFilter.
@Override
public AuthModule createModuleFilter(AbstractAuthenticationModuleType moduleType, String sequenceSuffix, ServletRequest request, Map<Class<?>, Object> sharedObjects, AuthenticationModulesType authenticationsPolicy, CredentialsPolicyType credentialPolicy, AuthenticationChannel authenticationChannel) throws Exception {
if (!(moduleType instanceof LdapAuthenticationModuleType)) {
LOGGER.error("This factory support only LdapAuthenticationModuleType, but modelType is " + moduleType);
return null;
}
isSupportedChannel(authenticationChannel);
LdapModuleWebSecurityConfiguration configuration = LdapModuleWebSecurityConfiguration.build(moduleType, sequenceSuffix);
configuration.setSequenceSuffix(sequenceSuffix);
configuration.addAuthenticationProvider(getProvider((LdapAuthenticationModuleType) moduleType));
LdapWebSecurityConfigurer<LdapModuleWebSecurityConfiguration> module = createModule(configuration);
HttpSecurity http = getNewHttpSecurity(module);
setSharedObjects(http, sharedObjects);
ModuleAuthenticationImpl moduleAuthentication = createEmptyModuleAuthentication((LdapAuthenticationModuleType) moduleType, configuration);
SecurityFilterChain filter = http.build();
return AuthModuleImpl.build(filter, configuration, moduleAuthentication);
}
use of org.springframework.security.web.SecurityFilterChain in project midpoint by Evolveum.
the class AbstractCredentialModuleFactory method createModuleFilter.
@Override
public AuthModule createModuleFilter(AbstractAuthenticationModuleType moduleType, String sequenceSuffix, ServletRequest request, Map<Class<?>, Object> sharedObjects, AuthenticationModulesType authenticationsPolicy, CredentialsPolicyType credentialPolicy, AuthenticationChannel authenticationChannel) throws Exception {
if (!(moduleType instanceof AbstractCredentialAuthenticationModuleType)) {
LOGGER.error("This factory supports only AbstractPasswordAuthenticationModuleType, but modelType is " + moduleType);
return null;
}
isSupportedChannel(authenticationChannel);
C configuration = createConfiguration(moduleType, sequenceSuffix, authenticationChannel);
configuration.addAuthenticationProvider(getProvider((AbstractCredentialAuthenticationModuleType) moduleType, credentialPolicy));
CA module = createModule(configuration);
HttpSecurity http = getNewHttpSecurity(module);
setSharedObjects(http, sharedObjects);
ModuleAuthenticationImpl moduleAuthentication = createEmptyModuleAuthentication(moduleType, configuration);
moduleAuthentication.setFocusType(moduleType.getFocusType());
SecurityFilterChain filter = http.build();
return AuthModuleImpl.build(filter, configuration, moduleAuthentication);
}
use of org.springframework.security.web.SecurityFilterChain in project midpoint by Evolveum.
the class HttpClusterModuleFactory method createModuleFilter.
@Override
public AuthModule createModuleFilter(AbstractAuthenticationModuleType moduleType, String sequenceSuffix, ServletRequest request, Map<Class<?>, Object> sharedObjects, AuthenticationModulesType authenticationsPolicy, CredentialsPolicyType credentialPolicy, AuthenticationChannel authenticationChannel) throws Exception {
ModuleWebSecurityConfiguration configuration = createConfiguration(moduleType, sequenceSuffix);
configuration.addAuthenticationProvider(createProvider());
HttpClusterModuleWebSecurityConfigurer<ModuleWebSecurityConfiguration> module = createModule(configuration);
HttpSecurity http = getNewHttpSecurity(module);
setSharedObjects(http, sharedObjects);
ModuleAuthenticationImpl moduleAuthentication = createEmptyModuleAuthentication(configuration);
SecurityFilterChain filter = http.build();
return AuthModuleImpl.build(filter, configuration, moduleAuthentication);
}
use of org.springframework.security.web.SecurityFilterChain in project open-kilda by telstra.
the class SecurityConfig method samlFilter.
@Bean
public FilterChainProxy samlFilter() throws Exception {
List<SecurityFilterChain> chains = new ArrayList<>();
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher(contextPath + SamlUrl.SAML_METADATA), metadataDisplayFilter()));
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher(contextPath + SamlUrl.SAML_LOGIN), samlEntryPoint()));
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher(contextPath + SamlUrl.SAML_SSO), samlWebSsoProcessingFilter()));
chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher(contextPath + SamlUrl.SAML_LOGOUT), samlLogoutFilter()));
return new FilterChainProxy(chains);
}
use of org.springframework.security.web.SecurityFilterChain in project app-template by xtuer.
the class DemoController method securityFilters.
/**
* 获取 Spring Security 的 filters
* URL: http://localhost:8080/demo/filters
*/
@GetMapping("/demo/filters")
@ResponseBody
public Map securityFilters() {
Map<String, Map<String, String>> filterChains = new HashMap<>();
int i = 1;
for (SecurityFilterChain chain : this.filterChainProxy.getFilterChains()) {
Map<String, String> filters = new HashMap<>();
int j = 1;
for (Filter filter : chain.getFilters()) {
filters.put("" + (j++), filter.getClass().getName());
}
filterChains.put("" + (i++), filters);
}
return filterChains;
}
Aggregations