Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. @EnableWebFluxSecurity
  2. @EnableReactiveMethodSecurity
  3. class SecurityConfig() {
  4.  
  5. @Bean
  6. fun securityWebFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
  7. http.httpBasic()
  8. .disable()
  9. .formLogin()
  10. .disable()
  11. .csrf()
  12. .disable()
  13. .logout()
  14. .disable()
  15.  
  16.  
  17. http.addFilterAt(authenticationFilter(), SecurityWebFiltersOrder.AUTHENTICATION)
  18. .authorizeExchange()
  19. .pathMatchers("/api/ping")
  20. .permitAll()
  21. .pathMatchers("/favicon.ico")
  22. .permitAll()
  23. .pathMatchers(HttpMethod.OPTIONS)
  24. .permitAll()
  25. .anyExchange()
  26. .authenticated()
  27.  
  28. return http.build()
  29. }
  30.  
  31. private fun authenticationFilter(): AuthenticationWebFilter {
  32. ...
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement