1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

Merge "Bug 462418 - Use stored password on non-preferred password based auth."

This commit is contained in:
Greg Watson 2015-03-25 09:37:36 -04:00 committed by Gerrit Code Review @ Eclipse.org
commit 91596fb8d7

View file

@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - Initial API and implementation
* Patrick Tasse - [462418] use stored password on non-preferred password based authentication
*******************************************************************************/
package org.eclipse.remote.internal.jsch.core;
@ -828,10 +829,13 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC
session.setUserInfo(new JSchUserInfo());
if (isPasswordAuth()) {
session.setConfig("PreferredAuthentications", "password,keyboard-interactive,gssapi-with-mic,publickey"); //$NON-NLS-1$ //$NON-NLS-2$
session.setPassword(getPassword());
} else {
session.setConfig("PreferredAuthentications", "publickey,gssapi-with-mic,password,keyboard-interactive"); //$NON-NLS-1$ //$NON-NLS-2$
}
String password = getPassword();
if (!password.isEmpty()) {
session.setPassword(password);
}
if (getProxyCommand().isEmpty() && getProxyConnectionName().isEmpty()) {
fJSchService.connect(session, getTimeout() * 1000, progress.newChild(10)); // connect without proxy
} else {