Class TrileadSSHPasswordAuthenticator
java.lang.Object
com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator<com.trilead.ssh2.Connection,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
com.cloudbees.jenkins.plugins.sshcredentials.impl.TrileadSSHPasswordAuthenticator
public class TrileadSSHPasswordAuthenticator
extends SSHAuthenticator<com.trilead.ssh2.Connection,com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials>
Does password auth with a
Connection
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Extension point to allow plugging inSSHAuthenticator
implementations for the many SSH client libraries available.Nested classes/interfaces inherited from class com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator
SSHAuthenticator.Mode
-
Constructor Summary
ConstructorDescriptionTrileadSSHPasswordAuthenticator
(com.trilead.ssh2.Connection connection, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user) Deprecated.TrileadSSHPasswordAuthenticator
(com.trilead.ssh2.Connection connection, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user, String username) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if the bound connection is in a state where authentication can be tried using the supplied credentials.protected boolean
SPI for authenticating the bound connection using the supplied credentials.Methods inherited from class com.cloudbees.jenkins.plugins.sshcredentials.SSHAuthenticator
authenticate, authenticate, authenticateOrFail, filter, getAuthenticationMode, getConnection, getListener, getPrivateKeys, getUser, getUsername, isAuthenticated, isSupported, matcher, matcher, newInstance, newInstance, newInstance, setListener
-
Constructor Details
-
TrileadSSHPasswordAuthenticator
@Deprecated public TrileadSSHPasswordAuthenticator(com.trilead.ssh2.Connection connection, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user) Deprecated.Constructor.- Parameters:
connection
- the connection we will be authenticating.
-
TrileadSSHPasswordAuthenticator
public TrileadSSHPasswordAuthenticator(@NonNull com.trilead.ssh2.Connection connection, @NonNull com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials user, @CheckForNull String username) Constructor.- Parameters:
connection
- the connection we will be authenticating.- Since:
- 1.4
-
-
Method Details
-
canAuthenticate
public boolean canAuthenticate()Returnstrue
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.
- Overrides:
canAuthenticate
in classSSHAuthenticator<com.trilead.ssh2.Connection,
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> - Returns:
true
if the bound connection is in a state where authentication can be tried using the supplied credentials.
-
doAuthenticate
protected boolean doAuthenticate()SPI for authenticating the bound connection using the supplied credentials.As a guideline, authentication errors should be reported to
SSHAuthenticator.getListener()
before this method returns withfalse
. 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)- Specified by:
doAuthenticate
in classSSHAuthenticator<com.trilead.ssh2.Connection,
com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials> - Returns:
true
if and only if authentication was successful.
-