agave-systems/systems-core/src/main/java/org/iplantc/service/remote/ssh/MaverickSSHSubmissionClient.java
/**
     * Looks through the supported auth returned from the server and overrides the
     * password auth type if the server only lists keyboard-interactive. This acts
     * as a frontline check to override the default behavior and use our
     * {@link MultiFactorKBIRequestHandler}.
     *
     * @param authenticationMethods the possible auth methods
     * @return a {@link SshAuthentication} based on the ordering and existence of auth methods returned from the server.
     */
Looks through the supported auth returned from the server and overrides the
password auth type if the server only lists keyboard-interactive. This acts
as a frontline check to override the default behavior and use our
MultiFactorKBIRequestHandler.

@param authenticationMethods the possible auth methods
@return a  SshAuthentication based on the ordering and existence of auth methods returned from the server.
Looks through the supported auth returned from the server and overrides the password auth type if the server only lists keyboard - interactive . This acts as a frontline check to override the default behavior and use our MultiFactorKBIRequestHandler . @param authenticationMethods the possible auth methods @return a SshAuthentication based on the ordering and existence of auth methods returned from the server .
private SshAuthentication checkForPasswordOverKBI(String[] authenticationMethods) {
        boolean kbiAuthenticationPossible = false;
        for (int i = 0; i < authenticationMethods.length; i++) {
            if (authenticationMethods[i].equals("password")) {
                return auth;
            }
            if (authenticationMethods[i].equals("keyboard-interactive")) {
                kbiAuthenticationPossible = true;
            }
        }
        if (kbiAuthenticationPossible) {
            KBIAuthentication kbi = new KBIAuthentication();
            kbi.setUsername(username);
            kbi.setKBIRequestHandler(new MultiFactorKBIRequestHandler(password, null, username, hostname, port));
            return kbi;
        }
        return auth;
    }
private SshAuthentication checkForPasswordOverKBI ( String [ ] authenticationMethods ) { boolean kbiAuthenticationPossible = false ; for ( int i = 0 ; i < authenticationMethods . length ; i ++ ) { if ( authenticationMethods [ i ] . equals ( "password" ) ) { return auth ; } if ( authenticationMethods [ i ] . equals ( "keyboard-interactive" ) ) { kbiAuthenticationPossible = true ; } } if ( kbiAuthenticationPossible ) { KBIAuthentication kbi = new KBIAuthentication ( ) ; kbi . setUsername ( username ) ; kbi . setKBIRequestHandler ( new MultiFactorKBIRequestHandler ( password , null , username , hostname , port ) ) ; return kbi ; } return auth ; }
Looks through the supported auth returned from the server and overrides the
 password auth type if the server only lists keyboard-interactive.
Looks through the supported auth returned from the server and overrides the password auth type if the server only lists keyboard - interactive .