public class AuthenticationProtocolServer extends Object implements Service
AuthenticationMechanism
. In this scenario you would simply call
either completedAuthentication()
or failedAuthentication()
to
inform the protocol that your authentication either completed or failed.Modifier and Type | Field and Description |
---|---|
static int |
SSH_MSG_USERAUTH_BANNER |
static int |
SSH_MSG_USERAUTH_FAILURE |
static int |
SSH_MSG_USERAUTH_REQUEST |
static int |
SSH_MSG_USERAUTH_SUCCESS |
Constructor and Description |
---|
AuthenticationProtocolServer(TransportProtocolServer transport)
Construct the protocol using the given transport
|
Modifier and Type | Method and Description |
---|---|
void |
addTask(Integer queue,
Runnable task) |
void |
completedAuthentication()
Each successful completion of an authentication method should call this
method.
|
void |
discardAuthentication()
Inform the protocol that the current authentication should be discarded.
|
void |
failedAuthentication()
A failed authentication attempt should call this method.
|
void |
failedAuthentication(boolean partial,
boolean ignoreFailed) |
SshServerContext |
getContext() |
int |
getIdleTimeoutSeconds()
How long does the service allow idle for?
|
String |
getName()
The service name
|
Object |
getParameter(String name) |
boolean |
processMessage(byte[] msg)
Process an SSH message.
|
void |
setParameter(String name,
Object value) |
void |
start()
Called by the
TransportProtocol when the service starts. |
void |
stop()
Called by the
TransportProtocol when the service stops. |
public static final int SSH_MSG_USERAUTH_REQUEST
public static final int SSH_MSG_USERAUTH_FAILURE
public static final int SSH_MSG_USERAUTH_SUCCESS
public static final int SSH_MSG_USERAUTH_BANNER
public AuthenticationProtocolServer(TransportProtocolServer transport)
transport
- IOException
public SshServerContext getContext()
public void stop()
TransportProtocol
when the service stops.public void start()
TransportProtocol
when the service starts. Here we
check for an authentication banner and send if configured.public boolean processMessage(byte[] msg) throws IOException
processMessage
in interface Service
msg
- the message to processIOException
public void completedAuthentication()
IOException
public void discardAuthentication()
public void failedAuthentication()
IOException
public void failedAuthentication(boolean partial, boolean ignoreFailed)
public int getIdleTimeoutSeconds()
Service
getIdleTimeoutSeconds
in interface Service
Copyright © 2016. All rights reserved.