Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
web filer 활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
ori0o0p committed Jan 23, 2024
1 parent eed58c6 commit 1628ea6
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package com.example.daemawiki.global.config;

import com.example.daemawiki.global.security.JwtWebFilter;
import com.example.daemawiki.global.security.Tokenizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
import org.springframework.security.config.web.server.ServerHttpSecurity;
import org.springframework.security.web.server.SecurityWebFilterChain;

@Configuration
@EnableWebFluxSecurity
public class SecurityConfig {

private final Tokenizer tokenizer;

public SecurityConfig(Tokenizer tokenizer) {
this.tokenizer = tokenizer;
}

private static final String[] WHITE_LIST = {
"/**"
};
Expand All @@ -21,6 +30,7 @@ public SecurityWebFilterChain filterChain(ServerHttpSecurity http) {
.anyExchange().authenticated())
.csrf(ServerHttpSecurity.CsrfSpec::disable)
.formLogin(ServerHttpSecurity.FormLoginSpec::disable)
.addFilterBefore(new JwtWebFilter(tokenizer), SecurityWebFiltersOrder.HTTP_BASIC)
.build();
}

Expand Down

0 comments on commit 1628ea6

Please sign in to comment.