本文整理汇总了Java中org.springframework.security.web.server.SecurityWebFilterChain类的典型用法代码示例。如果您正苦于以下问题:Java SecurityWebFilterChain类的具体用法?Java SecurityWebFilterChain怎么用?Java SecurityWebFilterChain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SecurityWebFilterChain类属于org.springframework.security.web.server包,在下文中一共展示了SecurityWebFilterChain类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: securityWebFilterChainSecure
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
@Profile("secure")
public SecurityWebFilterChain securityWebFilterChainSecure(ServerHttpSecurity http) {
// @formatter:off
return http.authorizeExchange()
.pathMatchers(adminContextPath + "/assets/**").permitAll()
.pathMatchers(adminContextPath + "/login").permitAll()
.anyExchange().authenticated()
.and()
.formLogin().loginPage(adminContextPath + "/login").and()
.logout().logoutUrl(adminContextPath + "/logout").and()
.httpBasic().and()
.csrf().disable()
.build();
// @formatter:on
}
开发者ID:codecentric,项目名称:spring-boot-admin,代码行数:17,代码来源:SpringBootAdminApplication.java
示例2: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
public SecurityWebFilterChain springWebFilterChain(HttpSecurity http) throws Exception {
return http
.authorizeExchange()
.anyExchange().permitAll()
// .anyExchange().authenticated()
.and()
.build();
}
开发者ID:saintdan,项目名称:spring-webflux-microservices-boilerplate,代码行数:10,代码来源:SecurityConfig.java
示例3: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain() {
return HttpSecurity.http()
.securityContextRepository(
new WebSessionSecurityContextRepository())
.authorizeExchange()
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:11,代码来源:SecurityConfiguration.java
示例4: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain() {
return HttpSecurity.http()
.securityContextRepository(new WebSessionSecurityContextRepository())
.authorizeExchange()
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:10,代码来源:SecurityConfiguration.java
示例5: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(HttpSecurity http) {
return http
.authorizeExchange()
.pathMatchers("/**").authenticated()
.and()
.build();
}
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:9,代码来源:SecurityConfiguration.java
示例6: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(HttpSecurity http) {
return http
.authorizeExchange()
.pathMatchers("/**").authenticated()
.and()
.build();
}
开发者ID:PacktPublishing,项目名称:Learning-Spring-Boot-2.0-Second-Edition,代码行数:9,代码来源:SecurityConfiguration.java
示例7: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:12,代码来源:DemoApplication.java
示例8: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:12,代码来源:SecurityConfig.java
示例9: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.csrf().disable()
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:13,代码来源:SecurityConfig.java
示例10: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
.pathMatchers("/posts/**").authenticated()
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().permitAll()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:13,代码来源:DemoApplication.java
示例11: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
//.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")//replace this with method level constraints
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:12,代码来源:SecurityConfig.java
示例12: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
//.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
//.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:12,代码来源:SecurityConfig.java
示例13: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.csrf().disable()
//.and()
.authorizeExchange()
.anyExchange().authenticated()
.and()
.httpBasic().securityContextRepository(new WebSessionServerSecurityContextRepository())
.and()
.formLogin()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:15,代码来源:SecurityConfig.java
示例14: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().authenticated()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:12,代码来源:SecurityConfig.java
示例15: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http
.authorizeExchange()
.pathMatchers(HttpMethod.GET, "/posts/**").permitAll()
.pathMatchers(HttpMethod.DELETE, "/posts/**").hasRole("ADMIN")
.pathMatchers("/posts/**").authenticated()
//.pathMatchers("/users/{user}/**").access(this::currentUserMatchesPath)
.anyExchange().permitAll()
.and()
.build();
}
开发者ID:hantsy,项目名称:spring-reactive-sample,代码行数:13,代码来源:DemoApplication.java
示例16: springSecurityFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http
.authorizeExchange()
.anyExchange().authenticated()
.and()
.httpBasic();
return http.build();
}
开发者ID:Angular2Guy,项目名称:AngularAndSpring,代码行数:10,代码来源:WebfluxSecurityConfig.java
示例17: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http.authorizeExchange()
.anyExchange().permitAll()
.and()
.csrf().disable()
.build();
}
开发者ID:spring-cloud,项目名称:spring-cloud-gateway,代码行数:9,代码来源:PermitAllSecurityConfiguration.java
示例18: springWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain springWebFilterChain(ServerHttpSecurity http) throws Exception {
return http.httpBasic().and()
.authorizeExchange()
.pathMatchers("/myapi/**").authenticated()
.anyExchange().permitAll()
.and()
.build();
}
开发者ID:spring-cloud,项目名称:spring-cloud-gateway,代码行数:10,代码来源:PrincipalNameKeyResolverIntegrationTests.java
示例19: securityWebFilterChainPermitAll
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
@Profile("insecure")
public SecurityWebFilterChain securityWebFilterChainPermitAll(ServerHttpSecurity http) {
return http.authorizeExchange().anyExchange().permitAll()//
.and().csrf().disable()//
.build();
}
开发者ID:codecentric,项目名称:spring-boot-admin,代码行数:8,代码来源:SpringBootAdminApplication.java
示例20: securityWebFilterChain
import org.springframework.security.web.server.SecurityWebFilterChain; //导入依赖的package包/类
@Bean
SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) {
return http.authorizeExchange().anyExchange().permitAll()//
.and().csrf().disable()//
.build();
}
开发者ID:codecentric,项目名称:spring-boot-admin,代码行数:7,代码来源:AdminApplicationHazelcastTest.java
注:本文中的org.springframework.security.web.server.SecurityWebFilterChain类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论