Java 类org.springframework.web.filter.CompositeFilter 实例源码

项目:emergentmud    文件:SecurityConfiguration.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();

    OAuth2ClientAuthenticationProcessingFilter facebookFilter = new OAuth2ClientAuthenticationProcessingFilter("/login/facebook");
    OAuth2RestTemplate facebookTemplate = new OAuth2RestTemplate(facebook(), oAuth2ClientContext);
    facebookFilter.setRestTemplate(facebookTemplate);
    facebookFilter.setTokenServices(new UserInfoTokenServices(facebookResource().getUserInfoUri(), facebook().getClientId()));
    filters.add(facebookFilter);

    OAuth2ClientAuthenticationProcessingFilter googleFilter = new OAuth2ClientAuthenticationProcessingFilter("/login/google");
    OAuth2RestTemplate googleTemplate = new OAuth2RestTemplate(google(), oAuth2ClientContext);
    googleFilter.setRestTemplate(googleTemplate);
    googleFilter.setTokenServices(new UserInfoTokenServices(googleResource().getUserInfoUri(), google().getClientId()));
    filters.add(googleFilter);

    filter.setFilters(filters);
    return filter;
}
项目:sns-todo    文件:FormLoginSecurityConfig.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    ClientResources github = github();
    filters.add(ssoFilter(github, "/login/github", new OAuth2RestTemplate(github.getClient(), oauth2ClientContext)));

    ClientResources sina = sina();
    filters.add(sinaSsoFilter(sina, new OAuth2RestTemplate(sina.getClient(), oauth2ClientContext)));

    filters.add(qqSsoFilter(qq()));

    filter.setFilters(filters);
    return filter;
}
项目:springboot-security-wechat    文件:SecurityConfig.java   
@Bean
public Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(ssoFilter(wechat(), "/login/wechat"));
    filter.setFilters(filters);
    return filter;
}
项目:service-authorization    文件:OAuthSecurityConfig.java   
@Override
  protected final void configure(HttpSecurity http) throws Exception {
      //@formatter:off
      http
              .antMatcher("/**")
              .authorizeRequests()
              .antMatchers(SSO_LOGIN_PATH + "/**", "/webjars/**", "/index.html", "/epam/**", "/info", "/health", "/api-docs/**")
              .permitAll()
              .anyRequest()
              .authenticated()
              .and().csrf().disable()
              .sessionManagement()
              .sessionCreationPolicy(SessionCreationPolicy.STATELESS);

      CompositeFilter authCompositeFilter = new CompositeFilter();
      List<OAuth2ClientAuthenticationProcessingFilter> additionalFilters = ImmutableList.<OAuth2ClientAuthenticationProcessingFilter>builder()
              .addAll(getDefaultFilters(oauth2ClientContext))
              .addAll(getAdditionalFilters(oauth2ClientContext)).build();

/* make sure filters have correct exception handler */
      additionalFilters.forEach(filter -> filter.setAuthenticationFailureHandler(OAUTH_ERROR_HANDLER));
      authCompositeFilter.setFilters(additionalFilters);

      //install additional OAuth Authentication filters
      http.addFilterAfter(authCompositeFilter, BasicAuthenticationFilter.class);
      //@formatter:on
  }
项目:restbucks-member    文件:WebSecurityConfiguration.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    filter.setFilters(new ArrayList<Filter>() {
        {
            add(ssoFilter("google", google()));
            add(ssoFilter("github", github()));
        }
    });
    return filter;
}
项目:spring_boot    文件:ApplicationConfiguration.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<Filter>();
    filters.add(this.ssoFilter(facebook(), "/login/facebook"));
    filters.add(this.ssoFilter(github(), "/login/github"));
    filter.setFilters(filters);
    return filter;
}
项目:Robocode    文件:SecurityConfig.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(this.ssoFilter(this.facebook(), "/login/facebook", OAuthSource.Facebook));
    filters.add(this.ssoFilter(this.github(), "/login/github", OAuthSource.GitHub));
    filters.add(this.ssoFilter(this.microsoft(), "/login/microsoft", OAuthSource.Microsoft));
    filter.setFilters(filters);
    return filter;
}
项目:marketplace    文件:WebSecurityConfig.java   
/**
 * Create custom SSO Filter for oauth providers, like GitHub.
 *
 * @return Filter {@link Filter}
 */
private Filter ssoFilter() {
    final CompositeFilter filter = new CompositeFilter();
    final List<Filter> filters = new ArrayList<>();
    filters.add(customSSOFilter(github(), "/login/github"));
    filter.setFilters(filters);
    return filter;
}
项目:nextrtc-videochat-with-rest    文件:WebSecurityConfig.java   
@Bean
public Filter ssoFilters() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = Lists.newArrayList();
    filters.add(ssoFilter(facebook(), "/login/facebook", "Facebook"));
    filters.add(ssoFilter(github(), "/login/github", "GitHub"));
    filter.setFilters(filters);
    return filter;
}
项目:come2help    文件:OAuth2ClientConfigurer.java   
private Filter createOAuth2Filter() {
    CompositeFilter filter = new CompositeFilter();
    filter.setFilters(Arrays.asList(
            createOAuth2Filter(facebook(), facebookSuccessHandler(), "/login/facebook"),
            createOAuth2Filter(google(), googleSuccessHandler(), "/login/google"))
    );
    return filter;
}
项目:codekvast    文件:WebSecurityConfig.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(ssoFilter(facebook(), "/login/facebook"));
    filters.add(ssoFilter(github(), "/login/github"));
    filters.add(ssoFilter(google(), "/login/google"));
    filter.setFilters(filters);
    return filter;
}
项目:JavaSecurity    文件:SsoWithGitHubApplication.java   
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(ssoFilter(github(), "/login/github"));
    filter.setFilters(filters);
    return filter;
}
项目:stagemonitor    文件:FilterProfilingTransformerTest.java   
@Test
public void testProfileServlet() throws Exception {
    Filter filter = new CompositeFilter();

    final CallStackElement total = Profiler.activateProfiling("total");
    filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(), new MockFilterChain());
    Profiler.stop();

    final CallStackElement serviceCall = total.getChildren().iterator().next();
    assertEquals("CompositeFilter#doFilter", serviceCall.getShortSignature());
}