Class OAuth2SecurityFilterChain

  • All Implemented Interfaces:
    org.springframework.core.Ordered, org.springframework.security.web.SecurityFilterChain

    public class OAuth2SecurityFilterChain
    extends Object
    implements org.springframework.security.web.SecurityFilterChain, org.springframework.core.Ordered
    Configures Spring Security as well as JAX-RS resources given an OAuth2 identity provider realm. Each realm must have a unique base path, which in turn for each a AuthenticationProvider is configured as well as a CXF server created.
    Author:
    Keivan Khalichi
    See Also:
    BirchProperties.IdPRealm
    • Field Detail

      • contextPathPattern

        public static final Pattern contextPathPattern
      • properties

        protected final org.birchframework.configuration.BirchProperties.IdPRealm properties
      • unsecureContextPaths

        protected final Set<String> unsecureContextPaths
    • Constructor Detail

      • OAuth2SecurityFilterChain

        public OAuth2SecurityFilterChain()
    • Method Detail

      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • matches

        public boolean matches​(javax.servlet.http.HttpServletRequest theRequest)
        Specified by:
        matches in interface org.springframework.security.web.SecurityFilterChain
      • getFilters

        public List<javax.servlet.Filter> getFilters()
        Specified by:
        getFilters in interface org.springframework.security.web.SecurityFilterChain
      • httpSecurity

        protected org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity()
                                                                                                 throws Exception
        Throws:
        Exception
      • createServices

        protected void createServices()
      • jwtAuthConverter

        protected org.springframework.core.convert.converter.Converter<org.springframework.security.oauth2.jwt.Jwt,​org.springframework.security.authentication.AbstractAuthenticationToken> jwtAuthConverter()
                                                                                                                                                                                                            throws Exception
        Throws:
        Exception
      • httpSecurity

        protected org.springframework.security.config.annotation.web.builders.HttpSecurity httpSecurity​(org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder theAuthenticationManagerBuilder)
                                                                                                 throws Exception
        Throws:
        Exception
      • normalizePath

        public static String normalizePath​(String thePath)