Class FSFedTerminationHandler


  • public class FSFedTerminationHandler
    extends Object
    Work engine that handles termination request/response.
    • Field Detail

      • response

        protected jakarta.servlet.http.HttpServletResponse response
      • request

        protected jakarta.servlet.http.HttpServletRequest request
      • locale

        protected String locale
      • ssoToken

        protected Object ssoToken
      • userID

        protected String userID
      • remoteDescriptor

        protected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType remoteDescriptor
      • hostedDescriptor

        protected com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType hostedDescriptor
      • hostedConfig

        protected com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig
      • relayState

        protected String relayState
      • termination_done_url

        protected static String termination_done_url
      • error_page_url

        protected static String error_page_url
      • FEDERATE_COOKIE_NAME

        protected static final String FEDERATE_COOKIE_NAME
      • realm

        protected String realm
      • hostedEntityId

        protected String hostedEntityId
      • remoteEntityId

        protected String remoteEntityId
      • metaAlias

        protected String metaAlias
      • hostedProviderRole

        protected String hostedProviderRole
    • Constructor Detail

      • FSFedTerminationHandler

        public FSFedTerminationHandler()
        Constructor. Initializes FSAccountManager, FSAllianceManager instance.
    • Method Detail

      • setTerminationURL

        protected void setTerminationURL()
        Invoked to set some commonly used URLs based on hosted provider.
      • setHostedDescriptor

        public void setHostedDescriptor​(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType hostedDescriptor)
        Sets state to the Federation Termination handler that is handling the current federation termination. The hosted provider identifies the provider who is handling the termnation request or initiating it locally.
        Parameters:
        hostedDescriptor - the Hosted provider Descriptor
      • setHostedDescriptorConfig

        public void setHostedDescriptorConfig​(com.sun.identity.federation.jaxb.entityconfig.BaseConfigType hostedConfig)
        Sets hosted provider's extended meta.
        Parameters:
        hostedConfig - hosted provider's extended config
      • setHostedEntityId

        public void setHostedEntityId​(String hostedId)
        Sets hosted provider's entity ID.
        Parameters:
        hostedId - hosted provider's entity id
      • setHostedProviderRole

        public void setHostedProviderRole​(String hostedProviderRole)
        Sets hosted provider's role.
        Parameters:
        hostedProviderRole - hosted provider's role
      • setMetaAlias

        public void setMetaAlias​(String metaAlias)
        Sets hosted provider's meta alias.
        Parameters:
        metaAlias - hosted provider's meta alias
      • setRealm

        public void setRealm​(String realm)
        Sets realm.
        Parameters:
        realm - The realm under which the entity resides.
      • setRemoteEntityId

        public void setRemoteEntityId​(String remoteId)
        Sets remote provider's entity ID.
        Parameters:
        remoteId - remote provider's entity id
      • setRemoteDescriptor

        public void setRemoteDescriptor​(com.sun.identity.liberty.ws.meta.jaxb.ProviderDescriptorType remoteDescriptor)
        Sets state to the Federation Termination handler that is handling the current federation termination. The remote provider identifies the provider who sent a request or with whom termination is to be initiated.
        Parameters:
        remoteDescriptor - the Remote provider Descriptor
      • setUserID

        public void setUserID​(String userID)
        Sets the UserID.
        Parameters:
        userID - the user who is initiating the termination process
      • setAccountInfo

        public void setAccountInfo​(FSAccountFedInfo acctInfo)
        Sets the federation account information for the user with a specific remote provider.
        Parameters:
        acctInfo - the account fed info object
      • setUserID

        public boolean setUserID​(FSFederationTerminationNotification reqTermination)
        Finds the user based on the termination request received from a remote provider.
        Parameters:
        reqTermination - the termination request
        Returns:
        true if the user is found; false otherwise.
      • handleFederationTermination

        public boolean handleFederationTermination​(jakarta.servlet.http.HttpServletRequest request,
                                                   jakarta.servlet.http.HttpServletResponse response,
                                                   Object ssoToken)
        Initiates the federation termination operation.
        Parameters:
        request - HTTP request
        response - HTTP response
        ssoToken - corresponding to the user's session
        Returns:
        true if the termination initiation operation is successful; false otherwise.
      • updateAccountInformation

        protected boolean updateAccountInformation​(NameIdentifier ni)
        Updates the user account information. After sucessful operation, the federation status corresponding to the user with the remote provider is set to inactive.
        Parameters:
        ni - NameIdentifier object corresponding to a user
        Returns:
        boolean containing the status of the update operation
      • processTerminationRequest

        public void processTerminationRequest​(jakarta.servlet.http.HttpServletRequest request,
                                              jakarta.servlet.http.HttpServletResponse response,
                                              FSFederationTerminationNotification reqTermination)
        Processes the termination request received from a remote provider. Invoded when Http redirect profile is used.
        Parameters:
        request - HTTP request
        response - HTTP response
        reqTermination - the federation termination request received from remote provider
      • processSOAPTerminationRequest

        public boolean processSOAPTerminationRequest​(jakarta.servlet.http.HttpServletRequest request,
                                                     jakarta.servlet.http.HttpServletResponse response,
                                                     FSFederationTerminationNotification reqTermination)
        Processes the termination request received from a remote provider. Invoded when SOAP profile is used.
        Parameters:
        reqTermination - the federation termination request received from remote provider
        Returns:
        true when the process is successful; false otherwise.
      • resetFederateCookie

        public void resetFederateCookie()
        Resets ederate cookie when termination is done with one remote provider. If no active federations exists then the cookie is set to "no"; otherwise it is set to "yes".
      • signTerminationRequest

        protected jakarta.xml.soap.SOAPMessage signTerminationRequest​(jakarta.xml.soap.SOAPMessage msg,
                                                                      String idAttrName,
                                                                      String id)
                                                               throws SAMLException
        Signs Federation termination request before sending it to the remote provider.
        Parameters:
        msg - SOAPMessage which includes termination request to be sent to remote provider
        idAttrName - name of the id attribute to be signed
        id - the value of the id attributer to be signed
        Returns:
        signed termination request in SOAPMessage
        Throws:
        SAMLException - if an error occurred during signing