Package restapi.utils.security.config
Class SecurityConfig
java.lang.Object
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
restapi.utils.security.config.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
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled=true)
class SecurityConfig
extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.springframework.security.web.util.matcher.RequestMatcher(package private) TokenAuthenticationProviderprivate static final org.springframework.security.web.util.matcher.RequestMatcher -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidconfigure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth) protected voidconfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) voidconfigure(org.springframework.security.config.annotation.web.builders.WebSecurity web) (package private) org.springframework.boot.web.servlet.FilterRegistrationBeanDisable Spring boot automatic filter registration.(package private) org.springframework.security.web.AuthenticationEntryPoint(package private) TokenAuthenticationFilter(package private) org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandlerMethods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
authenticationManager, authenticationManagerBean, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean
-
Field Details
-
PUBLIC_URLS
private static final org.springframework.security.web.util.matcher.RequestMatcher PUBLIC_URLS -
PROTECTED_URLS
private static final org.springframework.security.web.util.matcher.RequestMatcher PROTECTED_URLS -
provider
TokenAuthenticationProvider provider
-
-
Constructor Details
-
SecurityConfig
SecurityConfig(TokenAuthenticationProvider provider)
-
-
Method Details
-
configure
protected void configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth) - Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
-
configure
public void configure(org.springframework.security.config.annotation.web.builders.WebSecurity web) - 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
-
configure
protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception - Overrides:
configurein classorg.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter- Throws:
Exception
-
restAuthenticationFilter
- Throws:
Exception
-
successHandler
@Bean org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler successHandler() -
disableAutoRegistration
@Bean org.springframework.boot.web.servlet.FilterRegistrationBean disableAutoRegistration(TokenAuthenticationFilter filter) Disable Spring boot automatic filter registration. -
forbiddenEntryPoint
@Bean org.springframework.security.web.AuthenticationEntryPoint forbiddenEntryPoint()
-