Class SwitchUserConfigurer<H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>

  • All Implemented Interfaces:
    org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,​H>

    public class SwitchUserConfigurer<H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
    extends org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer<SwitchUserConfigurer<H>,​H>
    Author:
    Filip Hrisafov
    • Field Detail

      • key

        protected java.lang.String key
      • cookieName

        protected java.lang.String cookieName
      • cookieMaxAge

        protected java.time.Duration cookieMaxAge
      • cookieDomain

        protected java.lang.String cookieDomain
      • exitUserUrl

        protected java.lang.String exitUserUrl
      • switchUserUrl

        protected java.lang.String switchUserUrl
      • userDetailsService

        protected org.springframework.security.core.userdetails.UserDetailsService userDetailsService
      • filterSecurityInterceptorObjectPostProcessor

        protected org.springframework.security.config.annotation.ObjectPostProcessor<org.springframework.security.web.access.intercept.FilterSecurityInterceptor> filterSecurityInterceptorObjectPostProcessor
    • Constructor Detail

      • SwitchUserConfigurer

        public SwitchUserConfigurer()
    • Method Detail

      • cookieName

        public SwitchUserConfigurer<H> cookieName​(java.lang.String cookieName)
        The name of the run as user cookie.
        Parameters:
        cookieName - the name of the cookie
        Returns:
        the SwitchUserConfigurer for further customization
      • cookieMaxAge

        public SwitchUserConfigurer<H> cookieMaxAge​(java.time.Duration cookieMaxAge)
        The max age for the run as user cookie.
        Parameters:
        cookieMaxAge - the max age of the cookie
        Returns:
        the SwitchUserConfigurer for further customization
      • cookieDomain

        public SwitchUserConfigurer<H> cookieDomain​(java.lang.String cookieDomain)
        The domain of the run as user cookie.
        Parameters:
        cookieDomain - the domain of the cookie
        Returns:
        the SwitchUserConfigurer for further customization
      • switchUserUrl

        public SwitchUserConfigurer<H> switchUserUrl​(java.lang.String switchUserUrl)
        The URL to respond to switch the user processing.
        Parameters:
        switchUserUrl - the switch user URL
        Returns:
        the SwitchUserConfigurer for further customization
      • exitUserUrl

        public SwitchUserConfigurer<H> exitUserUrl​(java.lang.String exitUserUrl)
        The URL to respond to exit the user switching.
        Parameters:
        exitUserUrl - the switch user URL
        Returns:
        the SwitchUserConfigurer for further customization
      • init

        public void init​(H builder)
        Specified by:
        init in interface org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,​H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
        Overrides:
        init in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,​H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
      • configure

        public void configure​(H builder)
                       throws java.lang.Exception
        Specified by:
        configure in interface org.springframework.security.config.annotation.SecurityConfigurer<org.springframework.security.web.DefaultSecurityFilterChain,​H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
        Overrides:
        configure in class org.springframework.security.config.annotation.SecurityConfigurerAdapter<org.springframework.security.web.DefaultSecurityFilterChain,​H extends org.springframework.security.config.annotation.web.HttpSecurityBuilder<H>>
        Throws:
        java.lang.Exception
      • getUserDetailsService

        protected org.springframework.security.core.userdetails.UserDetailsService getUserDetailsService​(org.springframework.context.ApplicationContext applicationContext)