List of usage examples for org.springframework.security.web.util.matcher RequestHeaderRequestMatcher RequestHeaderRequestMatcher
public RequestHeaderRequestMatcher(String expectedHeaderName, String expectedHeaderValue)
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; }