|
AXL Software™ | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectTACACSClient
TACACS+ Client for applications. This provides a platform independent way to authenticate and perform accounting for an entity. The TACACS+ client is in compliance with tac-rfc.1.78.txt (draft-grant-tacacs-02.txt), the only known standard.
| Field Summary | |
static int |
DEFAULT_PORT
Port number (49) for TACACS+ server - 49. |
static int |
SOCKET_TIMEOUT
Default TACACS+ timeout, value = 10000 ms. |
static String |
Version
Client software version number ("1.15") |
| Constructor Summary | |
TACACSClient(InetAddress tHost,
int port,
String secret)
Class constructor creates the TACACS+ Client. |
|
TACACSClient(InetAddress tHost,
int port,
String secret,
int timeout)
Class constructor creates the TACACS+ Client. |
|
| Method Summary | |
Packet |
accounting(int acctType,
TACACSSession session)
Send Accounting information. |
Packet |
authentication(int authenType,
TACACSSession session,
byte[] data)
Send Authentication information. |
Packet |
authenticationContinue(int authenType,
TACACSSession session,
int flag,
byte[] userMessage,
byte[] data)
Send Authentication CONTINUE information. |
Packet |
authorization(int action,
TACACSSession session)
Send Authorization information. |
void |
close()
End the client. |
TACACSSession |
createSession(TACACSCallback callback)
Create a session. |
void |
enableEncryption(boolean encrypt)
Enable or disable packet encryption on a global scale. |
void |
enableMultipleSessions(boolean enable)
Enable or disable multiple sessions by this client. |
byte[] |
getSecret()
Get the NAS secret. |
void |
logToDebug(String msg)
Log a message to the debug file or stdout if debugging hasn't been set up. |
void |
removeSession(TACACSSession session)
Remove a TACACSSession from the client. |
void |
reset()
Reset the connection between transactions. |
boolean |
setDebug(boolean debug)
Set debugging on or off. |
void |
setDebug(boolean debug,
String fileName)
Set debugging on or off. |
String |
toString()
Return representation of the TACACS+ connection. |
| Methods inherited from class Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final String Version
public static final int DEFAULT_PORT
public static final int SOCKET_TIMEOUT
| Constructor Detail |
public TACACSClient(InetAddress tHost,
int port,
String secret)
throws SocketException,
IOException
tHost - The TACACS+ host address.port - Port number for the TACACS+ host.secret - The shared secret between this client and the TACACS+ server.
SocketException - Socket creation problems.
IOException
public TACACSClient(InetAddress tHost,
int port,
String secret,
int timeout)
throws SocketException,
UnknownHostException,
IOException
tHost - The TACACS+ host name or address.port - Port number for the TACACS+ host.secret - The shared secret between this client and the TACACS+ server.timeout - Socket timeout in milliseconds.
SocketException - Socket creation problems.
IOException - Socket creation problems.
UnknownHostException - Unknown remote host.| Method Detail |
public void reset()
throws SocketException,
IOException
SocketException - if there's a problem creating the socket.
SocketException - if there's a problem creating the streams..
IOException
public void setDebug(boolean debug,
String fileName)
throws IOException
debug - Use true to enable debugging, false to disable debugging.fileName - Debugging information will be written to this file. If the file name is null
the standard output is used.
IOException - if there's a problem opening the debugging output.logToDebug()public boolean setDebug(boolean debug)
debug - Use true to enable debugging, false to disable debugging.
The standard output is used.
public void logToDebug(String msg)
msg - Message to write.setDebug()public void enableEncryption(boolean encrypt)
TACACSSession.enableEncryption().
Note that the server will continue to encrypt packets if it is configured
to do so.
The default is send packets encrypted but for debugging purposes
encryption can be disabled.
encrypt - Encrypt the packet if true, disable encryption if false.public void enableMultipleSessions(boolean enable)
enable - True to enable multiple sessions, false to disable them.
The default is enable multiple sessions.public TACACSSession createSession(TACACSCallback callback)
"The concept of a session is used throughout this document. A TACACS+ session is a single authentication sequence, a single authorization exchange, or a single accounting exchange. It is used by both ends to distinguish between packets belonging to multiple sessions"
callback - The object that implements TACACSCallback which will
be called when a reply is returned.
If the callback value is null no callback will be made and the reply packet is made available
by the
accounting(),
authorization(),
authentication(),
and
authenticationContinue()
methods.public void removeSession(TACACSSession session)
enableMultipleSessions().
session - TACACSSession.
public Packet accounting(int acctType,
TACACSSession session)
throws ClientSendException,
ClientReceiveException,
TACACSException
createSession
the TACACSCallback interface will be used.
Otherwise the reply packet can be obtained directly from this method.
acctType - Accounting type.session - TACACSSession to send.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.
TACACSException - if something else goes wrong.
public Packet authorization(int action,
TACACSSession session)
throws ClientSendException,
ClientReceiveException,
TACACSException
createSession
the TACACSCallback interface will be used.
Otherwise the reply packet can be obtained directly from this method.
action - Action, e.g. TAC_PLUS_AUTHEN_LOGIN.session - TACACSSession to send.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.
TACACSException - if something else goes wrong.
public Packet authentication(int authenType,
TACACSSession session,
byte[] data)
throws ClientSendException,
ClientReceiveException,
TACACSException
createSession
the TACACSCallback interface will be used.
Otherwise the reply packet can be obtained directly from this method.
authenType - Authentication type.session - TACACSSession to send.data - Data to send for the particular type of authentication.
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.
TACACSException - if something else goes wrong.
public Packet authenticationContinue(int authenType,
TACACSSession session,
int flag,
byte[] userMessage,
byte[] data)
throws ClientSendException,
ClientReceiveException,
TACACSException
createSession
Otherwise the reply packet can be obtained directly from this method.
the TACACSCallback interface will be used.
authenType - Authentication type.session - TACACSSession to send.flag - A flag value of either
TAC.TAC_PLUS_CONTINUE_FLAG_ABORT or
TAC.TAC_PLUS_CONTINUE_FLAG_OK.userMessage - The name, password, or other data requested (may be set to null).data - Data Other data related to the authentication (may be set to null).
ClientSendException - If a problem occurs sending a packet.
ClientReceiveException - If a problem occurs receiving a packet.
TACACSException - if something else goes wrong.public void close()
public String toString()
public byte[] getSecret()
|
AXL Software™ | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||