public class JSchSSHPasswordAuthenticator extends SSHAuthenticator<JSchConnector,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
| Modifier and Type | Class and Description |
|---|---|
static class |
JSchSSHPasswordAuthenticator.Factory
Extension point to allow plugging in
SSHAuthenticator implementations for the many SSH client libraries
available. |
SSHAuthenticator.Mode| Modifier | Constructor and Description |
|---|---|
protected |
JSchSSHPasswordAuthenticator(JSchConnector connection,
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user) |
protected |
JSchSSHPasswordAuthenticator(JSchConnector connection,
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user,
String username) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canAuthenticate()
Returns
true if the bound connection is in a state where authentication can be tried using the
supplied credentials. |
protected boolean |
doAuthenticate()
SPI for authenticating the bound connection using the supplied credentials.
|
SSHAuthenticator.Mode |
getAuthenticationMode()
Returns the mode of authentication that this
SSHAuthenticator supports. |
authenticate, authenticate, authenticateOrFail, filter, getConnection, getListener, getPrivateKeys, getUser, getUsername, isAuthenticated, isSupported, matcher, matcher, newInstance, newInstance, newInstance, setListenerprotected JSchSSHPasswordAuthenticator(@NonNull
JSchConnector connection,
@NonNull
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user)
protected JSchSSHPasswordAuthenticator(@NonNull
JSchConnector connection,
@NonNull
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user,
@CheckForNull
String username)
@NonNull public SSHAuthenticator.Mode getAuthenticationMode()
SSHAuthenticatorSSHAuthenticator supports.getAuthenticationMode in class SSHAuthenticator<JSchConnector,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>SSHAuthenticator supports.public boolean canAuthenticate()
SSHAuthenticatortrue if the bound connection is in a state where authentication can be tried using the
supplied credentials.
Subclasses can override this if they can tell whether it is possible to make an authentication attempt, default implementation is one-shot always.
canAuthenticate in class SSHAuthenticator<JSchConnector,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>true if the bound connection is in a state where authentication can be tried using the
supplied credentials.protected boolean doAuthenticate()
SSHAuthenticator
As a guideline, authentication errors should be reported to SSHAuthenticator.getListener()
before this method returns with false. This helps an user better understand
what is tried and failing. Logging can be used in addition to this to capture further details.
(in contrast, please avoid reporting a success to the listener to improve S/N ratio)
doAuthenticate in class SSHAuthenticator<JSchConnector,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>true if and only if authentication was successful.Copyright © 2016–2020. All rights reserved.