Package com.Server.security
Class WebSecurityConfig
java.lang.Object
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
com.Server.security.WebSecurityConfig
- 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
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled=true,
jsr250Enabled=true,
prePostEnabled=true)
public class WebSecurityConfig
extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
Class security use to supervision a endpoint.
- Since:
- 2020-04-27.
- Version:
- 2.0.
- Author:
- Krystian Cwioro Kamil Bieniasz Damian Mierzynski.
-
Field Summary
Fields Modifier and Type Field Description private AuthenticationEntryPointJwtauthenticationEntryPointJwtClass to represent AuthenticationEntryPointJwt(package private) UserDetailsServiceImpluserDetailsServiceClass to represent UserDetails -
Constructor Summary
Constructors Constructor Description WebSecurityConfig() -
Method Summary
Modifier and Type Method Description org.springframework.security.authentication.AuthenticationManagerauthenticationManagerBean()AuthenticationTokenFilterauthenticationTokenFilter()Method to AuthenticationTokenFiltervoidconfigure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder authenticationManagerBuilder)protected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)voidconfigure(org.springframework.security.config.annotation.web.builders.WebSecurity web)org.springframework.security.crypto.password.PasswordEncoderpasswordEncoder()Methods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
authenticationManager, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBeanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
userDetailsService
Class to represent UserDetails -
authenticationEntryPointJwt
Class to represent AuthenticationEntryPointJwt
-
-
Constructor Details
-
WebSecurityConfig
public WebSecurityConfig()
-
-
Method Details
-
authenticationTokenFilter
Method to AuthenticationTokenFilter -
configure
public void configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder authenticationManagerBuilder) throws java.lang.Exception- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
java.lang.Exception
-
authenticationManagerBean
@Bean public org.springframework.security.authentication.AuthenticationManager authenticationManagerBean() throws java.lang.Exception- Overrides:
authenticationManagerBeanin classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
java.lang.Exception
-
passwordEncoder
@Bean public org.springframework.security.crypto.password.PasswordEncoder passwordEncoder() -
configure
public void configure(org.springframework.security.config.annotation.web.builders.WebSecurity web) throws java.lang.Exception- Specified by:
configurein interfaceorg.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
java.lang.Exception
-
configure
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws java.lang.Exception- Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
java.lang.Exception
-