Class WebSecurityConfigurer

java.lang.Object
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
es.kukenan.smartfi.springboot.config.security.WebSecurityConfigurer
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>

@EnableWebSecurity @Configuration @EnableGlobalMethodSecurity(prePostEnabled=true, securedEnabled=true) public class WebSecurityConfigurer extends org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
REST API security configuration.
  • Field Details

  • Constructor Details

    • WebSecurityConfigurer

      public WebSecurityConfigurer()
  • Method Details

    • 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
    • doDefaultConfigure

      void doDefaultConfigure(org.springframework.security.config.annotation.web.builders.HttpSecurity http) throws Exception
      Default web security configuration.
      Parameters:
      http - HttpSecurity instance.
      Throws:
      Exception - if any exception is thrown.
    • handleResponse

      private void handleResponse(org.springframework.http.ResponseEntity<Object> response, javax.servlet.http.HttpServletResponse httpServletResponse) throws IOException
      Handles a response created at the RestExceptionHandler and writes the required http json error response.
      Parameters:
      response - the response created at RestExceptionHandler.
      httpServletResponse - the HttpServletResponse.
      Throws:
      IOException - if an exception is thrown writing the response to the output stream.
    • exceptionHandlerFilter

      private javax.servlet.Filter exceptionHandlerFilter()
    • outputResponse

      private void outputResponse(org.springframework.http.ResponseEntity<Object> responseEntity, javax.servlet.http.HttpServletResponse httpServletResponse)
      Write the given response entity to the http servlet response.
      Parameters:
      responseEntity - the response entity.
      httpServletResponse - the http servlet request.