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


Java SecurityWebFilterChain类代码示例

本文整理汇总了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
}
 
开发者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


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