本文整理汇总了Java中org.springframework.web.filter.CompositeFilter.setFilters方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeFilter.setFilters方法的具体用法?Java CompositeFilter.setFilters怎么用?Java CompositeFilter.setFilters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.filter.CompositeFilter
的用法示例。
在下文中一共展示了CompositeFilter.setFilters方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}