Package net.schmizz.sshj.userauth.method
Class AuthPassword
java.lang.Object
net.schmizz.sshj.userauth.method.AbstractAuthMethod
net.schmizz.sshj.userauth.method.AuthPassword
- All Implemented Interfaces:
SSHPacketHandler
,AuthMethod
Implements the
password
authentication method. Password-change request handling is not currently supported.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PasswordUpdateProvider
private static final PasswordUpdateProvider
private final PasswordFinder
Fields inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
log, params
-
Constructor Summary
ConstructorsConstructorDescriptionAuthPassword
(PasswordFinder pwdf) AuthPassword
(PasswordFinder pwdf, PasswordUpdateProvider newPasswordProvider) -
Method Summary
Modifier and TypeMethodDescriptionbuildReq()
Builds aSSHPacket
containing the fields common to all authentication method.void
Delegate handling of some SSH packet to this object.boolean
Returnstrue
if the associatedPasswordFinder
tells that we should retry with a new password that it will supply.Methods inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
getName, init, makeAccountResource, request, setLoggerFactory
-
Field Details
-
pwdf
-
nullProvider
-
newPasswordProvider
-
-
Constructor Details
-
AuthPassword
-
AuthPassword
-
-
Method Details
-
buildReq
Description copied from class:AbstractAuthMethod
Builds aSSHPacket
containing the fields common to all authentication method. Method-specific fields can further be put into this buffer.- Overrides:
buildReq
in classAbstractAuthMethod
- Throws:
UserAuthException
-
handle
Description copied from interface:SSHPacketHandler
Delegate handling of some SSH packet to this object.- Specified by:
handle
in interfaceSSHPacketHandler
- Overrides:
handle
in classAbstractAuthMethod
- Parameters:
cmd
- the SSHmessage identifier
buf
-SSHPacket
containing rest of the request- Throws:
UserAuthException
TransportException
-
shouldRetry
public boolean shouldRetry()Returnstrue
if the associatedPasswordFinder
tells that we should retry with a new password that it will supply.- Specified by:
shouldRetry
in interfaceAuthMethod
- Overrides:
shouldRetry
in classAbstractAuthMethod
- Returns:
- whether authentication should be reattempted if it failed.
-