java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.server.apps.security.ServerConfig
All Implemented Interfaces:
org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration @EnableWebSecurity public class ServerConfig extends Object implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
Performs a web server configuration for tomcat.
Author:
Holger Eichelberger, SSE
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private de.iip_ecosphere.platform.support.aas.AuthenticationDescriptor
     
    private org.springframework.web.servlet.HandlerInterceptor
    Implements the authentication interceptor.
    private static ThreadLocal<Object>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
     
    static Object
    Returns the security principal determined by the authentication interceptor.
    org.springframework.boot.web.servlet.server.ServletWebServerFactory
    servletContainer(SSLConnectorCustomizer sslConnectorCustomizer)
    Creates the servlet web server factory.
    org.springframework.security.core.userdetails.UserDetailsService
    Provides the user details service.
    org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer
    Provides the web security customizer, in particular helpful for debugging.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer

    addArgumentResolvers, addCorsMappings, addErrorResponseInterceptors, addFormatters, addResourceHandlers, addReturnValueHandlers, addViewControllers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configureMessageConverters, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
  • Field Details

    • principal

      private static ThreadLocal<Object> principal
    • authDesc

      @Autowired(required=false) private de.iip_ecosphere.platform.support.aas.AuthenticationDescriptor authDesc
    • authInterceptor

      private org.springframework.web.servlet.HandlerInterceptor authInterceptor
      Implements the authentication interceptor.
  • Constructor Details

    • ServerConfig

      public ServerConfig()
  • Method Details

    • getPrincipal

      public static Object getPrincipal()
      Returns the security principal determined by the authentication interceptor.
      Returns:
      the principal, may be null
    • servletContainer

      @Bean public org.springframework.boot.web.servlet.server.ServletWebServerFactory servletContainer(SSLConnectorCustomizer sslConnectorCustomizer)
      Creates the servlet web server factory.
      Parameters:
      sslConnectorCustomizer - the connector customizer
      Returns:
      the factory instance
    • addInterceptors

      public void addInterceptors(org.springframework.web.servlet.config.annotation.InterceptorRegistry registry)
      Specified by:
      addInterceptors in interface org.springframework.web.servlet.config.annotation.WebMvcConfigurer
    • userDetailsService

      @Bean public org.springframework.security.core.userdetails.UserDetailsService userDetailsService()
      Provides the user details service.
      Returns:
      the user details service
    • webSecurityCustomizer

      @Bean public org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer webSecurityCustomizer()
      Provides the web security customizer, in particular helpful for debugging.
      Returns:
      the customizer