com.maverick.ssh2
Interface AuthenticationClient

All Superinterfaces:
SshAuthentication
All Known Implementing Classes:
KBIAuthentication, Ssh2HostbasedAuthentication, Ssh2PasswordAuthentication, Ssh2PublicKeyAuthentication

public interface AuthenticationClient
extends SshAuthentication

Base interface for all SSH authentication mechanisms. Each authentication mechanism must conform to this interface which is called by the AuthenticationProtocol after the user invokes the authenticate method. Using the methods of the AuthenticationProtocol the implementation must read and send messages are required by the authentication specification. When the server return's either a SSH_MSG_USERAUTH_SUCCESS or SSH_MSG_USERAUTH_FAILURE the readMessage method will throw AuthenticationResult and return back to the AuthenticationProtocol. This throwable class can also be thrown by the implementor from within the mechanisms implementation, for instance if the user cancelled the authentication.

Author:
Lee David Painter

Field Summary
 
Fields inherited from interface com.maverick.ssh.SshAuthentication
CANCELLED, COMPLETE, FAILED, FURTHER_AUTHENTICATION_REQUIRED, PUBLIC_KEY_ACCEPTABLE
 
Method Summary
 void authenticate(AuthenticationProtocol authentication, java.lang.String servicename)
          Perform the authentication according to the specification.
 
Methods inherited from interface com.maverick.ssh.SshAuthentication
getMethod, getUsername, setUsername
 

Method Detail

authenticate

public void authenticate(AuthenticationProtocol authentication,
                         java.lang.String servicename)
                  throws SshException,
                         com.maverick.ssh2.AuthenticationResult
Perform the authentication according to the specification. The expected result of this method is for the caller to catch an AuthenticationResult. If the method returns without throwing this then the caller will attempt to read the next message available expecting it to be either a SSH_MSG_USERAUTH_SUCCESS or SSH_MSG_USERAUTH_FAILURE.

Parameters:
authentication -
servicename -
Throws:
java.io.IOException
AuthenticationResult
SshException


Copyright © 2003 3SP LTD. All Rights Reserved.