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


Java OAuth2ClientContextFilter类代码示例

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


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

示例1: configure

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        .addFilterAfter(new OAuth2ClientContextFilter(), AbstractPreAuthenticatedProcessingFilter.class)
        .addFilterAfter(facebookLoginFilter, OAuth2ClientContextFilter.class)
        .authorizeRequests()
        .antMatchers("/", "/callback").permitAll().and()
        .authorizeRequests()
        .antMatchers("/profile/*").authenticated().and()
        .authorizeRequests().anyRequest().authenticated().and()
        .httpBasic().authenticationEntryPoint(
            new LoginUrlAuthenticationEntryPoint("/callback")).and()
            .logout().logoutSuccessUrl("/").permitAll().and()
            .headers().frameOptions().disable().and()
            .csrf().disable();
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:17,代码来源:SecurityConfiguration.java

示例2: configure

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
        .addFilterAfter(new OAuth2ClientContextFilter(), AbstractPreAuthenticatedProcessingFilter.class)
        .addFilterAfter(openIdConnectFilter, OAuth2ClientContextFilter.class)
        .authorizeRequests()
        .antMatchers("/").permitAll().and()
        .authorizeRequests()
        .antMatchers(apiBaseUri).authenticated().and()
        .authorizeRequests().anyRequest().authenticated().and()
        .httpBasic().authenticationEntryPoint(
            new LoginUrlAuthenticationEntryPoint(callbackUri)).and()
            .logout()
            .logoutSuccessUrl("/")
            .permitAll().and()
            .csrf().disable();
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:18,代码来源:SecurityConfiguration.java

示例3: configure

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
            .addFilterAfter(new OAuth2ClientContextFilter(), AbstractPreAuthenticatedProcessingFilter.class)
            .addFilterAfter(openIdConnectFilter, OAuth2ClientContextFilter.class)
            .authorizeRequests()
            .antMatchers("/").permitAll().and()
            .authorizeRequests()
            .antMatchers(apiBaseUri).authenticated().and()
            .authorizeRequests().anyRequest().authenticated().and()
            .httpBasic().authenticationEntryPoint(
            new LoginUrlAuthenticationEntryPoint(callbackUri)).and()
            .logout()
            .logoutSuccessUrl("/")
            .permitAll().and()
            .csrf().disable();
}
 
开发者ID:PacktPublishing,项目名称:OAuth-2.0-Cookbook,代码行数:18,代码来源:SecurityConfiguration.java

示例4: configure

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Override
protected void configure(HttpSecurity http) throws Exception {
    http
    .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()
    .addFilterAfter(new OAuth2ClientContextFilter(), 
      AbstractPreAuthenticatedProcessingFilter.class)
    .addFilterAfter(filter, 
      OAuth2ClientContextFilter.class)
    .httpBasic()
    .authenticationEntryPoint(new LoginUrlAuthenticationEntryPoint("/google-login"))
    .and()
    .authorizeRequests()
    .antMatchers("/api/v1/users**").hasAuthority("ADMIN")
    .antMatchers("/api/v1/notes**").hasAnyAuthority("ADMIN", "AUTHOR")
    .antMatchers("/").hasAuthority("ADMIN")
    .antMatchers("/swagger-ui.html").hasAuthority("ADMIN");
}
 
开发者ID:daflockinger,项目名称:poppynotes,代码行数:18,代码来源:SecurityConfig.java

示例5: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean<OAuth2ClientContextFilter> oauth2ClientFilterRegistration(
		OAuth2ClientContextFilter filter, SecurityProperties security) {
	FilterRegistrationBean<OAuth2ClientContextFilter> registration = new FilterRegistrationBean<>();
	registration.setFilter(filter);
	registration.setOrder(security.getFilter().getOrder() - 10);
	return registration;
}
 
开发者ID:spring-projects,项目名称:spring-security-oauth2-boot,代码行数:9,代码来源:OAuth2RestOperationsConfiguration.java

示例6: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(
        OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:Microsoft,项目名称:movie-db-java-on-azure,代码行数:9,代码来源:SecurityConfig.java

示例7: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();

    registration.setFilter(filter);
    registration.setOrder(-100);

    return registration;
}
 
开发者ID:scionaltera,项目名称:emergentmud,代码行数:10,代码来源:SecurityConfiguration.java

示例8: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:luotuo,项目名称:springboot-security-wechat,代码行数:8,代码来源:SecurityConfig.java

示例9: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
FilterRegistrationBean oauth2ClientFilterRegistration(OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:reportportal,项目名称:service-authorization,代码行数:8,代码来源:OAuthSecurityConfig.java

示例10: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
protected FilterRegistrationBean oauth2ClientFilterRegistration(
        OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    //register it with a sufficiently low order that it comes before the main Spring Security filter.
    //In this way we can use it to handle redirects signaled by exceptions in authentication requests.
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:restbucks,项目名称:restbucks-member,代码行数:11,代码来源:WebSecurityConfiguration.java

示例11: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
protected FilterRegistrationBean oauth2ClientFilterRegistration(OAuth2ClientContextFilter filter)
{
  FilterRegistrationBean registration = new FilterRegistrationBean();
  registration.setFilter(filter);
  registration.setOrder(-100);
  return registration;
}
 
开发者ID:fetox74,项目名称:eve-oauth2-example,代码行数:9,代码来源:EveOAuth2Example.java

示例12: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(
		OAuth2ClientContextFilter filter, SecurityProperties security) {
	FilterRegistrationBean registration = new FilterRegistrationBean();
	registration.setFilter(filter);
	registration.setOrder(security.getFilterOrder() - 10);
	return registration;
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:9,代码来源:OAuth2RestOperationsConfiguration.java

示例13: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
/**
 * @param filter
 *            the {@link OAuth2ClientContextFilter} to register.
 * @return the Spring {@link FilterRegistrationBean} to register a filter in
 *         the spring filter-chain
 */
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(final OAuth2ClientContextFilter filter) {
    final FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:eclipse,项目名称:hawkbit-extensions,代码行数:14,代码来源:UaaOAuthAutoConfiguration.java

示例14: oauth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean
public FilterRegistrationBean oauth2ClientFilterRegistration(
		OAuth2ClientContextFilter filter) {
	FilterRegistrationBean registration = new FilterRegistrationBean();
	registration.setFilter(filter);
	registration.setOrder(-100);
	return registration;
}
 
开发者ID:Nephilim84,项目名称:contestparser,代码行数:9,代码来源:OAuth2RestOperationsConfiguration.java

示例15: oAuth2ClientFilterRegistration

import org.springframework.security.oauth2.client.filter.OAuth2ClientContextFilter; //导入依赖的package包/类
@Bean // handles the redirect to facebook
public FilterRegistrationBean oAuth2ClientFilterRegistration(OAuth2ClientContextFilter filter) {
    FilterRegistrationBean registration = new FilterRegistrationBean();
    registration.setFilter(filter);
    registration.setOrder(-100);
    return registration;
}
 
开发者ID:andreas-eberle,项目名称:spring-oauth2-jwt-minimal,代码行数:8,代码来源:OAuth2ClientConfigurer.java


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