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-interactiveauthentication method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAuthKeyboardInteractive.CharArrWrap
-
Field Summary
Fields Modifier and Type Field Description private ChallengeResponseProviderprovider-
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.StringbuildCommaSeparatedSubmethodList()SSHPacketbuildReq()Builds aSSHPacketcontaining the fields common to all authentication method.voidhandle(Message cmd, SSHPacket buf)Delegate handling of some SSH packet to this object.private voidrespond(AuthKeyboardInteractive.CharArrWrap[] userReplies)booleanshouldRetry()-
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:AbstractAuthMethodBuilds aSSHPacketcontaining the fields common to all authentication method. Method-specific fields can further be put into this buffer.- Overrides:
buildReqin classAbstractAuthMethod- Throws:
UserAuthException
-
buildCommaSeparatedSubmethodList
private java.lang.String buildCommaSeparatedSubmethodList()
-
handle
public void handle(Message cmd, SSHPacket buf) throws UserAuthException, TransportException
Description copied from interface:SSHPacketHandlerDelegate handling of some SSH packet to this object.- Specified by:
handlein interfaceSSHPacketHandler- Overrides:
handlein classAbstractAuthMethod- Parameters:
cmd- the SSHmessage identifierbuf-SSHPacketcontaining rest of the request- Throws:
UserAuthExceptionTransportException
-
respond
private void respond(AuthKeyboardInteractive.CharArrWrap[] userReplies) throws TransportException
- Throws:
TransportException
-
shouldRetry
public boolean shouldRetry()
- Specified by:
shouldRetryin interfaceAuthMethod- Overrides:
shouldRetryin classAbstractAuthMethod- Returns:
- whether authentication should be reattempted if it failed.
-
-