Class FSNameRegistrationHandler


  • public class FSNameRegistrationHandler
    extends Object
    Work class that handles registration process.
    • Field Detail

      • response

        protected jakarta.servlet.http.HttpServletResponse response
      • request

        protected jakarta.servlet.http.HttpServletRequest request
      • regisMap

        protected HashMap regisMap
      • 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
      • metaAlias

        protected String metaAlias
      • relayState

        protected String relayState
      • REGISTRATION_DONE_URL

        protected static String REGISTRATION_DONE_URL
      • returnMap

        protected HashMap returnMap
      • returnURL

        protected static String returnURL
      • regisSource

        protected static String regisSource
      • remoteEntityId

        protected String remoteEntityId
      • realm

        protected String realm
      • hostedEntityId

        protected String hostedEntityId
      • hostedProviderRole

        protected String hostedProviderRole
    • Constructor Detail

      • FSNameRegistrationHandler

        public FSNameRegistrationHandler()
        Constructor. Initializes FSAccountManager, meta Manager instance.
    • Method Detail

      • setRegistrationURL

        protected void setRegistrationURL()
        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 hosted provider descriptor. This function is called from FSServiceManager to give state to the name registration handler that is handling the current name registration. The hosted provider identifies the provider who is handling the registration 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 meta.
      • setHostedEntityId

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

        public void setHostedProviderRole​(String hostedRole)
        Sets hosted provider's role.
        Parameters:
        hostedRole - 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 remote provider descriptor. This function is called to give state to the Name registration handler The remote provider identifies the provider who sent a request or with whom registration is to be initiated.
        Parameters:
        remoteDescriptor - the Remote provider Descriptor
      • setUserID

        public void setUserID​(String userID)
        Sets the UserDN.
        Parameters:
        userID - the user who is initiating
      • 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
      • setUserDN

        public boolean setUserDN​(FSNameRegistrationRequest regisRequest)
        Determines the user based on the registration request received from a remote provider.
        Parameters:
        regisRequest - the name registration request
        Returns:
        true a user is found; false otherwise.
      • handleNameRegistration

        public boolean handleNameRegistration​(jakarta.servlet.http.HttpServletRequest request,
                                              jakarta.servlet.http.HttpServletResponse response,
                                              Object ssoToken)
        Initiates the name registration operation.
        Parameters:
        request - HTTP request
        response - HTTP response
        ssoToken - corresponding to the user's session
        Returns:
        the status of the registration initiation operation. true if successful; false otherwise.
      • handleNameRegistration

        public boolean handleNameRegistration​(jakarta.servlet.http.HttpServletRequest request,
                                              jakarta.servlet.http.HttpServletResponse response,
                                              Object ssoToken,
                                              HashMap valMap)
        Handles the name registration after sso.
        Parameters:
        request - HTTP request
        response - HTTP response
        ssoToken - corresponding to the users's session
        Returns:
        the status of the registration initiation operation. true if successful; false otherwise.
      • handleRegistrationAfterFederation

        public boolean handleRegistrationAfterFederation​(String LRURL,
                                                         jakarta.servlet.http.HttpServletResponse response)
        Does local name registration and initiates remote registration with the IDP.
        Parameters:
        LRURL - the final return URL after Name registration is complete
        response - HTTP response object
        Returns:
        true if successful; false otherwise.
      • processRegistrationResponse

        public boolean processRegistrationResponse​(jakarta.servlet.http.HttpServletRequest request,
                                                   jakarta.servlet.http.HttpServletResponse response,
                                                   FSNameRegistrationResponse regisResponse)
        Initiates the name registration operation.
        Parameters:
        request - HTTP request
        response - HTTP response
        regisResponse - FSNameRegistrationResponse object
        Returns:
        true if the operation succeeds; false otherwise.
      • processRegistrationRequest

        public void processRegistrationRequest​(jakarta.servlet.http.HttpServletRequest request,
                                               jakarta.servlet.http.HttpServletResponse response,
                                               FSNameRegistrationRequest regisRequest)
        Processes the registration request received from a remote provider. Invoded when Http redirect profile is used.
        Parameters:
        request - HTTP request
        response - HTTP response
        regisRequest - the name registration request received from remote provider
      • processSOAPRegistrationRequest

        public FSNameRegistrationResponse processSOAPRegistrationRequest​(jakarta.servlet.http.HttpServletRequest request,
                                                                         jakarta.servlet.http.HttpServletResponse response,
                                                                         FSNameRegistrationRequest regisRequest)
        Processes the name registration request received from a remote provider. Invoded when SOAP profile is used.
        Parameters:
        regisRequest - the name registration request received from remote provider
      • returnLocallyAtSource

        public void returnLocallyAtSource​(jakarta.servlet.http.HttpServletResponse response,
                                          boolean isSuccess)
        Redirects to final destination after registration. Invoked at the end of the registration operation at the end where registration was initiated. The isSuccess determines if a success message or a failure message is displayed.
        Parameters:
        response - HttpServletResponse object
        isSuccess - determines the content of the registration-done.jsp
      • signRegistrationRequest

        protected jakarta.xml.soap.SOAPMessage signRegistrationRequest​(jakarta.xml.soap.SOAPMessage msg,
                                                                       String idAttrName,
                                                                       String id)
                                                                throws SAMLException,
                                                                       FSMsgException
        Signs the Name registration request before sending it to the IDP.
        Parameters:
        msg - the request message to be sent to IDP
        idAttrName - name of the id attribute to be signed
        id - the value of the id attribute to be signed
        Returns:
        signed Name registration request
        Throws:
        SAMLException
        FSMsgException
      • verifyResponseSignature

        protected boolean verifyResponseSignature​(jakarta.xml.soap.SOAPMessage msg,
                                                  boolean isIDP)
        Verifies the Name registration response received from the IDP before processing locally.
        Parameters:
        msg - the response message
        isIDP - whether the remote provider is an IDP or not
        Returns:
        true if signature is valid; false otherwise.