Package com.bytedesk.core.config
Class WebSecurityConfig
java.lang.Object
com.bytedesk.core.config.WebSecurityConfig
@Configuration
@EnableWebSecurity
@EnableMethodSecurity
@Description("Web Security Configuration - Web\u5b89\u5168\u914d\u7f6e\u7c7b\uff0c\u914d\u7f6eJWT\u8ba4\u8bc1\u3001CORS\u3001CSRF\u7b49\u5b89\u5168\u7b56\u7565")
public class WebSecurityConfig
extends Object
https://github.com/pengjinning/spring-boot-3-jwt-security
https://github.com/pengjinning/spring-boot-spring-security-jwt-authentication
https://dev.to/jean_claude_van_debug/spring-security-mutliple-authentication-providers-new-spring-boot-3-e1j
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
private AuthEntryPoint
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.authentication.AuthenticationProvider
https://wankhedeshubham.medium.com/spring-boot-security-with-userdetailsservice-and-custom-authentication-provider-3df3a188993forg.springframework.security.web.SecurityFilterChain
securityFilterChain
(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
-
Field Details
-
passwordEncoder
@Autowired private org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder passwordEncoder -
unauthorizedHandler
-
-
Constructor Details
-
WebSecurityConfig
public WebSecurityConfig()
-
-
Method Details
-
securityFilterChain
@Bean public org.springframework.security.web.SecurityFilterChain securityFilterChain(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Throws:
Exception
-
authTokenFilter
-
authenticationProvider
@Bean public org.springframework.security.authentication.AuthenticationProvider authenticationProvider()https://wankhedeshubham.medium.com/spring-boot-security-with-userdetailsservice-and-custom-authentication-provider-3df3a188993f- Returns:
-