Java 类org.springframework.security.web.util.matcher.RequestHeaderRequestMatcher 实例源码

项目:citizenship-appointment-server    文件:AdminSecurityConfigurerAdapter.java   
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        .csrf()
            .disable()
        .sessionManagement()
            .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
            .and()
        .requestCache()
            .disable()
        .antMatcher("/monitoring/**")
            .authorizeRequests()
            .requestMatchers(new RequestHeaderRequestMatcher("x-forwarded-proto", "https"))
            .hasAnyRole(ROLE_ADMIN)
            .and()
        .httpBasic();
}
项目:juiser    文件: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;
}
项目:incubator-atlas    文件: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;
}
项目:iris    文件:SecurityConfig.java   
@Bean
@Autowired
public DelegatingAuthenticationEntryPoint delegatingAuthenticationEntryPoint(BasicAuthenticationEntryPoint basic,
    LoginUrlAuthenticationEntryPoint login) {

    LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints = new LinkedHashMap<>();
    entryPoints.put(new RequestHeaderRequestMatcher("Content-Type", "application/json"), basic);
    entryPoints.put(new NegatedRequestMatcher(new RequestContainingAcceptTextHeaderRequestMatcher()), basic);

    DelegatingAuthenticationEntryPoint delegate = new DelegatingAuthenticationEntryPoint(entryPoints);
    delegate.setDefaultEntryPoint(login);

    return delegate;
}
项目:jhipster-registry    文件:OAuth2SecurityConfiguration.java   
@Bean
@Qualifier("authorizationHeaderRequestMatcher")
public RequestMatcher authorizationHeaderRequestMatcher() {
    return new RequestHeaderRequestMatcher("Authorization");
}
项目:AndroidFT    文件:AFTTokenAuthenticationFilter.java   
/** Creates a new AFT Token Authentication Filter with the default request matcher
 * 
 */
public AFTTokenAuthenticationFilter() {
    super(new RequestHeaderRequestMatcher(AFTAuthentication.AFT_SESSION_TOKEN_HEADER));
}
项目:generator-jhipster    文件:_MicroserviceSecurityConfiguration.java   
@Bean
@Qualifier("authorizationHeaderRequestMatcher")
public RequestMatcher authorizationHeaderRequestMatcher() {
    return new RequestHeaderRequestMatcher("Authorization");
}