Package net.schmizz.sshj.userauth.method
Class AuthKeyboardInteractive
- java.lang.Object
-
- net.schmizz.sshj.userauth.method.AbstractAuthMethod
-
- net.schmizz.sshj.userauth.method.AuthKeyboardInteractive
-
- All Implemented Interfaces:
SSHPacketHandler
,AuthMethod
public class AuthKeyboardInteractive extends AbstractAuthMethod
Implements thekeyboard-interactive
authentication method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
AuthKeyboardInteractive.CharArrWrap
-
Field Summary
Fields Modifier and Type Field Description private ChallengeResponseProvider
provider
-
Fields inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
log, params
-
-
Constructor Summary
Constructors Constructor Description AuthKeyboardInteractive(ChallengeResponseProvider provider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.String
buildCommaSeparatedSubmethodList()
SSHPacket
buildReq()
Builds aSSHPacket
containing the fields common to all authentication method.void
handle(Message cmd, SSHPacket buf)
Delegate handling of some SSH packet to this object.private void
respond(AuthKeyboardInteractive.CharArrWrap[] userReplies)
boolean
shouldRetry()
-
Methods inherited from class net.schmizz.sshj.userauth.method.AbstractAuthMethod
getName, init, makeAccountResource, request, setLoggerFactory
-
-
-
-
Field Detail
-
provider
private final ChallengeResponseProvider provider
-
-
Constructor Detail
-
AuthKeyboardInteractive
public AuthKeyboardInteractive(ChallengeResponseProvider provider)
-
-
Method Detail
-
buildReq
public SSHPacket buildReq() throws UserAuthException
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
-
buildCommaSeparatedSubmethodList
private java.lang.String buildCommaSeparatedSubmethodList()
-
handle
public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException
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
-
respond
private void respond(AuthKeyboardInteractive.CharArrWrap[] userReplies) throws TransportException
- Throws:
TransportException
-
shouldRetry
public boolean shouldRetry()
- Specified by:
shouldRetry
in interfaceAuthMethod
- Overrides:
shouldRetry
in classAbstractAuthMethod
- Returns:
- whether authentication should be reattempted if it failed.
-
-