Example usage for org.springframework.security.web.util.matcher AntPathRequestMatcher AntPathRequestMatcher

List of usage examples for org.springframework.security.web.util.matcher AntPathRequestMatcher AntPathRequestMatcher

Introduction

In this page you can find the example usage for org.springframework.security.web.util.matcher AntPathRequestMatcher AntPathRequestMatcher.

Prototype

public AntPathRequestMatcher(String pattern) 

Source Link

Document

Creates a matcher with the specific pattern which will match all HTTP methods in a case insensitive manner.

Usage

From source file:jp.pigumer.sso.WebSecurityConfig.java

/**
 * SAML Filter.//from  w  w  w. j a  va 2  s  .co m
 * @return SAMLFilter
 * @throws Exception Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()));
    chains.add(
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
            samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));
    return new FilterChainProxy(chains);
}

From source file:com.naveen.demo.config.Saml2SSOConfig.java

/**
 * Define the security filter chain in order to support SSO Auth by using SAML 2.0
 * //from   w  w w  .j a v a 2 s  .  com
 * @return Filter chain proxy
 * @throws Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    List<SecurityFilterChain> chains = new ArrayList<SecurityFilterChain>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()));
    chains.add(
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
            metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
            samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
            samlIDPDiscovery()));
    return new FilterChainProxy(chains);
}

From source file:com.netflix.genie.web.security.saml.SAMLConfig.java

/**
 * Define the security filter chain in order to support SSO Auth by using SAML 2.0.
 *
 * @return Filter chain proxy// ww w.j a  v a2s.com
 * @throws Exception on any configuration problem
 * @see FilterChainProxy
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {
    final List<SecurityFilterChain> chains = new ArrayList<>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()));
    chains.add(
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
            metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
            samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/discovery/**"),
            samlIDPDiscovery()));
    return new FilterChainProxy(chains);
}

From source file:it.infn.mw.iam.config.saml.SamlConfig.java

/**
 * Define the security filter chain in order to support SSO Auth by using SAML 2.0
 * //from   www.  j a  v a  2  s  . c  o m
 * @return Filter chain proxy @throws Exception
 */
@Bean
public FilterChainProxy samlFilter() throws Exception {

    List<SecurityFilterChain> chains = new ArrayList<>();
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/login/**"), samlEntryPoint()));
    chains.add(
            new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/logout/**"), samlLogoutFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/metadata/**"),
            metadataDisplayFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSO/**"),
            samlWebSSOProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SSOHoK/**"),
            samlWebSSOHoKProcessingFilter()));
    chains.add(new DefaultSecurityFilterChain(new AntPathRequestMatcher("/saml/SingleLogout/**"),
            samlLogoutProcessingFilter()));

    return new FilterChainProxy(chains);
}

From source file:nu.localhost.tapestry5.springsecurity.services.RequestInvocationDefinition.java

public RequestInvocationDefinition(String pattern, String roles, Long id) {
    this.requestMatcher = new AntPathRequestMatcher(pattern);
    String[] allAttrs = StringUtils.stripAll(StringUtils.splitPreserveAllTokens(roles, ','));
    this.configAttributes = new ArrayList<ConfigAttribute>();
    for (String attr : allAttrs) {
        this.configAttributes.add(new SecurityConfig(attr));
    }/*from   w  w  w . j a va2  s.  c  om*/

}

From source file:org.cloudfoundry.identity.uaa.metrics.UaaMetricsFilter.java

public UaaMetricsFilter() throws IOException {
    perUriMetrics.put(MetricsUtil.GLOBAL_GROUP, new MetricsQueue());
    urlGroups = new LinkedHashMap<>();
    List<UrlGroup> groups = getUrlGroups();
    groups.stream().forEach(group -> urlGroups.put(new AntPathRequestMatcher(group.getPattern()), group));
}

From source file:org.cloudfoundry.identity.uaa.web.LimitedModeUaaFilter.java

public void setPermittedEndpoints(Set<String> permittedEndpoints) {
    this.permittedEndpoints = permittedEndpoints;
    if (permittedEndpoints == null) {
        this.endpoints = emptyList();
    } else {//from  w  ww . ja v a 2  s . co m
        this.endpoints = permittedEndpoints.stream().map(s -> new AntPathRequestMatcher(s)).collect(toList());
    }
}

From source file:org.dspace.app.rest.security.StatelessLoginFilter.java

public StatelessLoginFilter(String url, AuthenticationManager authenticationManager,
        RestAuthenticationService restAuthenticationService) {
    super(new AntPathRequestMatcher(url));
    this.authenticationManager = authenticationManager;
    this.restAuthenticationService = restAuthenticationService;
}