Class AbstactKeycloakDelegateAuthenticationHandler

  • All Implemented Interfaces:
    DelegateAuthenticationFilterHandler

    public abstract class AbstactKeycloakDelegateAuthenticationHandler
    extends Object
    implements DelegateAuthenticationFilterHandler
    This class provides predinied workflow for authenticating Vertigo users with a keycloak server using OpenIdConnect protocol. It is mainly insipired by the KeycloakOIDCFilter provided by Keycloak
    Version:
    $Revision: 1 $
    Author:
    mlaroche, Bill Burke
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.keycloak.adapters.AdapterDeploymentContext deploymentContext  
      protected org.keycloak.adapters.spi.SessionIdMapper idMapper  
      protected static org.apache.logging.log4j.Logger log  
      protected org.keycloak.adapters.NodesRegistrationManagement nodesRegistrationManagement  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void doAfterChain​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Code to execute before the after to the filter chain.
      io.vertigo.core.lang.Tuple<Boolean,​javax.servlet.http.HttpServletRequest> doBeforeChain​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Code to execute before the call to the filter chain.
      void doFinally​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
      Code to execute in a finally block that wraps all the calls to this delegate and the filter chain
      abstract boolean doLogin​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)  
      void init​(io.vertigo.connectors.keycloak.KeycloakDeploymentConnector keycloakDeploymentConnector)  
    • Field Detail

      • log

        protected static final org.apache.logging.log4j.Logger log
      • deploymentContext

        protected org.keycloak.adapters.AdapterDeploymentContext deploymentContext
      • idMapper

        protected final org.keycloak.adapters.spi.SessionIdMapper idMapper
      • nodesRegistrationManagement

        protected org.keycloak.adapters.NodesRegistrationManagement nodesRegistrationManagement
    • Constructor Detail

      • AbstactKeycloakDelegateAuthenticationHandler

        public AbstactKeycloakDelegateAuthenticationHandler()
    • Method Detail

      • init

        public void init​(io.vertigo.connectors.keycloak.KeycloakDeploymentConnector keycloakDeploymentConnector)
      • doBeforeChain

        public io.vertigo.core.lang.Tuple<Boolean,​javax.servlet.http.HttpServletRequest> doBeforeChain​(javax.servlet.http.HttpServletRequest request,
                                                                                                             javax.servlet.http.HttpServletResponse response)
        Code to execute before the call to the filter chain.
        Specified by:
        doBeforeChain in interface DelegateAuthenticationFilterHandler
        Parameters:
        request - the httpRequest
        response - the httpResponse
        Returns:
        a tuple composed of two values : - a boolean to indicate wether the request has been handled in the method and chain must be stopped - the HttpRequest that will be transfered in the filter chain. (for example if you need to wrap it for any reason )
      • doLogin

        public abstract boolean doLogin​(javax.servlet.http.HttpServletRequest request,
                                        javax.servlet.http.HttpServletResponse response)
      • doAfterChain

        public void doAfterChain​(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
        Code to execute before the after to the filter chain.
        Specified by:
        doAfterChain in interface DelegateAuthenticationFilterHandler
        Parameters:
        request - the httpRequest
        response - the httpResponse
      • doFinally

        public void doFinally​(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
        Code to execute in a finally block that wraps all the calls to this delegate and the filter chain
        Specified by:
        doFinally in interface DelegateAuthenticationFilterHandler
        Parameters:
        request - the httpRequest
        response - the httpResponse