Skip to content

Commit

Permalink
feat :: 필터 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
4mjeo committed Feb 28, 2024
1 parent c092950 commit 29accfa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.v1oauthauthorizationservice.infrastructure.configuration.security

import com.example.v1oauthauthorizationservice.infrastructure.configuration.AuthenticationFilter
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.core.Ordered
Expand All @@ -11,10 +12,13 @@ import org.springframework.security.config.http.SessionCreationPolicy
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
import org.springframework.security.crypto.password.PasswordEncoder
import org.springframework.security.web.SecurityFilterChain
import org.springframework.security.web.access.intercept.AuthorizationFilter

@EnableWebSecurity(debug = true)
@Configuration
class SecurityConfiguration {
class SecurityConfiguration(
private val authenticationFilter: AuthenticationFilter
) {

@Bean
fun passwordEncoder(): PasswordEncoder = BCryptPasswordEncoder()
Expand All @@ -36,6 +40,7 @@ class SecurityConfiguration {
.sessionManagement()
.sessionCreationPolicy(SessionCreationPolicy.STATELESS).and()

httpSecurity.addFilterBefore(authenticationFilter, AuthorizationFilter::class.java)

httpSecurity
.authorizeHttpRequests { authorize ->
Expand Down

0 comments on commit 29accfa

Please sign in to comment.