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

    Fields
    Modifier and Type
    Field
    Description
    private static final org.springframework.security.web.util.matcher.RequestMatcher
     
    (package private) TokenAuthenticationProvider
     
    private static final org.springframework.security.web.util.matcher.RequestMatcher
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth)
     
    protected void
    configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http)
     
    void
    configure(org.springframework.security.config.annotation.web.builders.WebSecurity web)
     
    (package private) org.springframework.boot.web.servlet.FilterRegistrationBean
    Disable Spring boot automatic filter registration.
    (package private) org.springframework.security.web.AuthenticationEntryPoint
     
    (package private) TokenAuthenticationFilter
     
    (package private) org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler
     

    Methods inherited from class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter

    authenticationManager, authenticationManagerBean, getApplicationContext, getHttp, init, setApplicationContext, setAuthenticationConfiguration, setContentNegotationStrategy, setObjectPostProcessor, setTrustResolver, userDetailsService, userDetailsServiceBean

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

  • Constructor Details

  • Method Details

    • configure

      protected void configure(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder auth)
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
    • configure

      public void configure(org.springframework.security.config.annotation.web.builders.WebSecurity web)
      Specified by:
      configure in interface org.springframework.security.config.annotation.SecurityConfigurer<javax.servlet.Filter,org.springframework.security.config.annotation.web.builders.WebSecurity>
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
    • configure

      protected void configure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Overrides:
      configure in class org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
      Throws:
      Exception
    • restAuthenticationFilter

      @Bean TokenAuthenticationFilter restAuthenticationFilter() throws Exception
      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()