Class UserAuthPassword

    • Field Detail

      • passwords

        private java.util.Iterator<java.lang.String> passwords
      • current

        private java.lang.String current
    • Constructor Detail

      • UserAuthPassword

        public UserAuthPassword()
    • Method Detail

      • init

        public void init​(ClientSession session,
                         java.lang.String service)
                  throws java.lang.Exception
        Specified by:
        init in interface UserAuth
        Overrides:
        init in class AbstractUserAuth
        Parameters:
        session - The ClientSession
        service - The requesting service name
        Throws:
        java.lang.Exception - If failed to initialize the mechanism
      • resolveAttemptedPassword

        protected java.lang.String resolveAttemptedPassword​(ClientSession session,
                                                            java.lang.String service)
                                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • sendPassword

        protected IoWriteFuture sendPassword​(Buffer buffer,
                                             ClientSession session,
                                             java.lang.String oldPassword,
                                             java.lang.String newPassword)
                                      throws java.lang.Exception
        Sends the password via a SSH_MSG_USERAUTH_REQUEST message. If old and new password are not the same then it requests a password modification from the server (which may be denied if the server does not support this feature).
        Parameters:
        buffer - The Buffer to re-use for sending the message
        session - The target ClientSession
        oldPassword - The previous password
        newPassword - The new password
        Returns:
        An IoWriteFuture that can be used to wait and check on the success/failure of the request packet being sent
        Throws:
        java.lang.Exception - If failed to send the message.
      • signalAuthMethodSuccess

        public void signalAuthMethodSuccess​(ClientSession session,
                                            java.lang.String service,
                                            Buffer buffer)
                                     throws java.lang.Exception
        Description copied from interface: UserAuth
        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

        public void signalAuthMethodFailure​(ClientSession session,
                                            java.lang.String service,
                                            boolean partial,
                                            java.util.List<java.lang.String> serverMethods,
                                            Buffer buffer)
                                     throws java.lang.Exception
        Description copied from interface: UserAuth
        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