当前位置: 首页>>代码示例>>Java>>正文


Java CompositeFilter类代码示例

本文整理汇总了Java中org.springframework.web.filter.CompositeFilter的典型用法代码示例。如果您正苦于以下问题:Java CompositeFilter类的具体用法?Java CompositeFilter怎么用?Java CompositeFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


CompositeFilter类属于org.springframework.web.filter包,在下文中一共展示了CompositeFilter类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
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;
}
 
开发者ID:scionaltera,项目名称:emergentmud,代码行数:20,代码来源:SecurityConfiguration.java

示例2: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
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;
}
 
开发者ID:helloworldtang,项目名称:sns-todo,代码行数:15,代码来源:FormLoginSecurityConfig.java

示例3: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
@Bean
public Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(ssoFilter(wechat(), "/login/wechat"));
    filter.setFilters(filters);
    return filter;
}
 
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:9,代码来源:SecurityConfig.java

示例4: configure

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
@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
  }
 
开发者ID:reportportal,项目名称:service-authorization,代码行数:28,代码来源:OAuthSecurityConfig.java

示例5: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    filter.setFilters(new ArrayList<Filter>() {
        {
            add(ssoFilter("google", google()));
            add(ssoFilter("github", github()));
        }
    });
    return filter;
}
 
开发者ID:restbucks,项目名称:restbucks-member,代码行数:11,代码来源:WebSecurityConfiguration.java

示例6: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
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;
}
 
开发者ID:adarshkumarsingh83,项目名称:spring_boot,代码行数:9,代码来源:ApplicationConfiguration.java

示例7: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
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;
}
 
开发者ID:HeroXXiv,项目名称:Robocode,代码行数:10,代码来源:SecurityConfig.java

示例8: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:inspectIT,项目名称:marketplace,代码行数:13,代码来源:WebSecurityConfig.java

示例9: ssoFilters

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
@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;
}
 
开发者ID:mslosarz,项目名称:nextrtc-videochat-with-rest,代码行数:10,代码来源:WebSecurityConfig.java

示例10: createOAuth2Filter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
private Filter createOAuth2Filter() {
    CompositeFilter filter = new CompositeFilter();
    filter.setFilters(Arrays.asList(
            createOAuth2Filter(facebook(), facebookSuccessHandler(), "/login/facebook"),
            createOAuth2Filter(google(), googleSuccessHandler(), "/login/google"))
    );
    return filter;
}
 
开发者ID:HelfenKannJeder,项目名称:come2help,代码行数:9,代码来源:OAuth2ClientConfigurer.java

示例11: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
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;
}
 
开发者ID:crispab,项目名称:codekvast,代码行数:10,代码来源:WebSecurityConfig.java

示例12: ssoFilter

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
private Filter ssoFilter() {
    CompositeFilter filter = new CompositeFilter();
    List<Filter> filters = new ArrayList<>();
    filters.add(ssoFilter(github(), "/login/github"));
    filter.setFilters(filters);
    return filter;
}
 
开发者ID:dschadow,项目名称:JavaSecurity,代码行数:8,代码来源:SsoWithGitHubApplication.java

示例13: testProfileServlet

import org.springframework.web.filter.CompositeFilter; //导入依赖的package包/类
@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());
}
 
开发者ID:stagemonitor,项目名称:stagemonitor,代码行数:12,代码来源:FilterProfilingTransformerTest.java


注:本文中的org.springframework.web.filter.CompositeFilter类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。