本文整理汇总了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();
}
示例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();
}
示例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();
}
示例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");
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}