Interface UserAuth

    • Method Detail

      • init

        void init​(ClientSession session,
                  java.lang.String service)
           throws java.lang.Exception
        Parameters:
        session - The ClientSession
        service - The requesting service name
        Throws:
        java.lang.Exception - If failed to initialize the mechanism
      • process

        boolean process​(Buffer buffer)
                 throws java.lang.Exception
        Parameters:
        buffer - The Buffer to process - null if not a response buffer, i.e., the underlying authentication mechanism should initiate whatever challenge/response mechanism is required
        Returns:
        true if request handled - false if the next authentication mechanism should be used
        Throws:
        java.lang.Exception - If failed to process the request
      • signalAuthMethodSuccess

        default void signalAuthMethodSuccess​(ClientSession session,
                                             java.lang.String service,
                                             Buffer buffer)
                                      throws java.lang.Exception
        Signal reception of SSH_MSG_USERAUTH_SUCCESS message
        Parameters:
        session - The ClientSession
        service - The requesting service name
        buffer - The Buffer containing the success message (after having consumed the relevant data from it)
        Throws:
        java.lang.Exception - If failed to handle the callback - Note: may cause session close
      • signalAuthMethodFailure

        default void signalAuthMethodFailure​(ClientSession session,
                                             java.lang.String service,
                                             boolean partial,
                                             java.util.List<java.lang.String> serverMethods,
                                             Buffer buffer)
                                      throws java.lang.Exception
        Signals reception of SSH_MSG_USERAUTH_FAILURE message
        Parameters:
        session - The ClientSession
        service - The requesting service name
        partial - true if some partial authentication success so far
        serverMethods - The List of authentication methods that can continue
        buffer - The Buffer containing the failure message (after having consumed the relevant data from it)
        Throws:
        java.lang.Exception - If failed to handle the callback - Note: may cause session close
      • destroy

        void destroy()
        Called to release any allocated resources