Package com.restapi.template.security
Class SecurityConfig
- java.lang.Object
-
- org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-
- com.restapi.template.security.SecurityConfig
-
- All Implemented Interfaces:
org.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>,org.springframework.security.config.annotation.web.WebSecurityConfigurer<org.springframework.security.config.annotation.web.builders.WebSecurity>
@Configuration public class SecurityConfig extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapterSpring Security 설정.- Version:
- 1.0
- Author:
- always0ne
-
-
Field Summary
Fields Modifier and Type Field Description private JwtTokenProviderjwtTokenProviderprivate com.fasterxml.jackson.databind.ObjectMapperobjectMapper
-
Constructor Summary
Constructors Constructor Description SecurityConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)Spring Security 설정.org.springframework.security.crypto.password.PasswordEncoderpasswordEncoder()PasswordEncoder Bean.-
Methods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
authenticationManager, authenticationManagerBean, configure, configure, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean
-
-
-
-
Field Detail
-
jwtTokenProvider
private final JwtTokenProvider jwtTokenProvider
-
objectMapper
private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Method Detail
-
configure
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.ExceptionSpring Security 설정. URL, 메소드별 접근권한 설정 JWT 인증 필터 추가- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Parameters:
http- HttpSecurity- Throws:
java.lang.Exception- See Also:
- "JwtAuthenticationFilter"
-
passwordEncoder
@Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()
PasswordEncoder Bean.- Returns:
- PasswordEncoder
-
-