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

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

Introduction

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

Prototype

public RequestHeaderRequestMatcher(String expectedHeaderName, String expectedHeaderValue) 

Source Link

Document

Creates a new instance that will match if a header by the name of #expectedHeaderName is present and if the #expectedHeaderValue is non-null the first value is the same.

Usage

From source file:org.juiser.spring.security.web.authentication.HeaderAuthenticationFilter.java

public HeaderAuthenticationFilter(String headerName, AuthenticationManager authenticationManager) {
    Assert.hasText(headerName, "headerName cannot be null or empty.");
    Assert.notNull("AuthenticationManager is required.");
    this.headerName = headerName;
    this.requiresAuthenticationRequestMatcher = new RequestHeaderRequestMatcher(headerName, null);
    this.authenticationManager = authenticationManager;
}

From source file:org.opendatakit.configuration.SecurityConfiguration.java

@Bean
DelegatingAuthenticationEntryPoint delegatingAuthenticationEntryPoint()
        throws ODKEntityNotFoundException, ODKOverQuotaException, ODKDatastoreException, PropertyVetoException {
    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<RequestMatcher, AuthenticationEntryPoint>();
    entryPoints.put(new RequestHeaderRequestMatcher("X-OpenRosa-Version", "1.0"), digestEntryPoint());
    entryPoints.put(new RequestHeaderRequestMatcher("X-OpenDataKit-Version", "2.0"), digestEntryPoint());
    DelegatingAuthenticationEntryPoint delegatingAuthenticationEntryPoint = new DelegatingAuthenticationEntryPoint(
            entryPoints);/*w  w w  . j  a va 2s  .  c o m*/
    delegatingAuthenticationEntryPoint.setDefaultEntryPoint(digestEntryPoint());
    return delegatingAuthenticationEntryPoint;
}

From source file:org.apache.atlas.web.security.AtlasSecurityConfig.java

public DelegatingAuthenticationEntryPoint getDelegatingAuthenticationEntryPoint() {
    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPointMap = new LinkedHashMap<>();
    entryPointMap.put(new RequestHeaderRequestMatcher("User-Agent", "Mozilla"), atlasAuthenticationEntryPoint);
    DelegatingAuthenticationEntryPoint entryPoint = new DelegatingAuthenticationEntryPoint(entryPointMap);
    entryPoint.setDefaultEntryPoint(getAuthenticationEntryPoint());
    return entryPoint;
}