Interface SSOProvider

  • All Known Subinterfaces:
    SSOProviderPlugin
    All Known Implementing Classes:
    AuthSSOProvider, OpenIdConnectSSOProvider, SSOProviderImpl, StatelessSSOProvider

    public interface SSOProvider
    SSOProvider is the interface that the SSO providers or the plug-ins need to implement. The implementation class that implements this interface MUST have the public default no-arg constructor because SSOTokenManger relies on that to dynamically instantiate an object of such class using Java Reflection.
    • Method Detail

      • createSSOToken

        SSOToken createSSOToken​(String sid,
                                boolean invokedByAuth,
                                boolean possiblyResetIdleTime)
                         throws SSOException,
                                UnsupportedOperationException
        Creates an SSOToken.
        Parameters:
        sid - String representing the SSOToken Id
        invokedByAuth - boolean flag indicating that this method has been invoked by the AuthContext.getSSOToken() API.
        possiblyResetIdleTime - If true, the idle time of the token/session may be reset to zero. If false, the idle time will never be reset.
        Returns:
        SSOToken
        Throws:
        SSOException - is thrown if the SSOToken can't be created.
        UnsupportedOperationException - is thrown when other unsupported operation is performed.
      • destroyToken

        void destroyToken​(SSOToken token)
                   throws SSOException
        Destroys an SSOToken.
        Parameters:
        token - The SSOToken object to be destroyed
        Throws:
        SSOException - is thrown if the SSOToken can't be destroyed.
      • isValidToken

        boolean isValidToken​(SSOToken token)
        Checks if an SSOToken is valid or not. Your token may be refreshed.
        Parameters:
        token - The SSOToken object to be validated.
        Returns:
        true or false, true if the token is valid
      • isValidToken

        boolean isValidToken​(SSOToken token,
                             boolean refresh)
        Checks if an SSOToken is valid or not.
        Parameters:
        token - The SSOToken object to be validated.
        refresh - Refresh the token only if this flag is set to true.
        Returns:
        true if the token is valid, false otherwise
      • validateToken

        void validateToken​(SSOToken token)
                    throws SSOException
        Checks if the SSOToken is valid.
        Throws:
        SSOException - is thrown if the SSOToken is not valid.
      • refreshSession

        void refreshSession​(SSOToken token)
                     throws SSOException
        Refresh the Session corresponding to the SSOToken from the Session Server, always resetting the idle time.
        Parameters:
        token - SSOToken
        Throws:
        SSOException - thrown if the session cannot be refreshed for the token
      • refreshSession

        void refreshSession​(SSOToken token,
                            boolean resetIdle)
                     throws SSOException
        Refresh the Session corresponding to the SSOToken from the Session Server, but only optionally resetting the idle time.
        Parameters:
        token - SSOToken
        resetIdle - if true, reset the idle time to zero, if false, do not do this.
        Throws:
        SSOException - thrown if the session cannot be refreshed for the token
      • destroyToken

        void destroyToken​(SSOToken destroyer,
                          SSOToken destroyed)
                   throws SSOException
        Destroys an SSOToken.
        Parameters:
        destroyer - The SSOToken object used to authorize the operation
        destroyed - The SSOToken object to be destroyed.
        Throws:
        SSOException - thrown if the there was an error during communication with session service.
      • logout

        void logout​(SSOToken token)
             throws SSOException
        Logs out of the session underlying this SSOToken.
        Parameters:
        token - the sso token to log out.
        Throws:
        SSOException - if an error occurs during logout.
      • getValidSessions

        Set<SSOToken> getValidSessions​(SSOToken requester,
                                       String server)
                                throws SSOException
        Returns valid Sessions.
        Parameters:
        requester - The SSOToken object used to authorize the operation
        server - The server for which the valid sessions are to be retrieved
        Returns:
        Set The set of Valid Sessions
        Throws:
        SSOException - thrown if the there was an error during communication with session service.