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