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 AuthenticationEntryPointJwt authenticationEntryPointJwt
    Class to represent AuthenticationEntryPointJwt
    (package private) UserDetailsServiceImpl userDetailsService
    Class to represent UserDetails
  • Constructor Summary

    Constructors
    Constructor Description
    WebSecurityConfig()  
  • Method Summary

    Modifier and Type Method Description
    org.springframework.security.authentication.AuthenticationManager authenticationManagerBean()  
    AuthenticationTokenFilter authenticationTokenFilter()
    Method to AuthenticationTokenFilter
    void configure​(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder authenticationManagerBuilder)  
    protected void configure​(org.springframework.security.config.annotation.web.builders.HttpSecurity http)  
    void configure​(org.springframework.security.config.annotation.web.builders.WebSecurity web)  
    org.springframework.security.crypto.password.PasswordEncoder passwordEncoder()  

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

    authenticationManager, 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

    • userDetailsService

      @Autowired UserDetailsServiceImpl userDetailsService
      Class to represent UserDetails
    • authenticationEntryPointJwt

      @Autowired private AuthenticationEntryPointJwt authenticationEntryPointJwt
      Class to represent AuthenticationEntryPointJwt
  • Constructor Details

    • WebSecurityConfig

      public WebSecurityConfig()
  • Method Details

    • authenticationTokenFilter

      @Bean public AuthenticationTokenFilter authenticationTokenFilter()
      Method to AuthenticationTokenFilter
    • configure

      public void configure​(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder authenticationManagerBuilder) throws java.lang.Exception
      Overrides:
      configure in class org.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:
      authenticationManagerBean in class org.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:
      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
      Throws:
      java.lang.Exception
    • configure

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