NAME
Net::TacacsPlus::Client - Tacacs+ client library
SYNOPSIS
use Net::TacacsPlus::Client;
use Net::TacacsPlus::Constants;
my $tac = new Net::TacacsPlus::Client(
host => 'localhost',
key => 'secret');
if ($tac->authenticate($username, $password, TAC_PLUS_AUTHEN_TYPE_PAP)){
print "Authentication successful.\n";
} else {
print "Authentication failed: ".$tac->errmsg()."\n";
}
my $args = ['service=shell', 'cmd=ping', 'cmd-arg=10.0.0.1'];
if($tac->authorize($username, $args))
{
print "Authorization successful.\n";
print "Arguments received from server:\n";
# $args is overwritten with arguments sent in server response (if any)
print join("\n", @{$args});
} else {
print "Authorization failed: " . $tac->errmsg() . "\n";
}
$args = ['service=shell', 'cmd=ping', 'cmd-arg=10.0.0.1'];
if($tac->account($username, $args))
{
print "Accounting successful.\n";
} else {
print "Accounting failed: " . $tac->errmsg() . "\n";
}
DESCRIPTION
Currently only PAP and ASCII authentication can be used agains Tacacs+ server.
AUTHOR
Jozef Kutej - <jozef@kutej.net>
Authorization and Accounting contributed by Rubio Vaughan <lt>rubio@passim.net<gt>
VERSION
1.03
SEE ALSO
tac-rfc.1.78.txt, Net::TacacsPlus::Packet
TODO
tacacs+ CHAP, ARAP, MSCHAP authentication
METHODS
- new( somekey => somevalue )
-
required parameters: host, key
host - tacacs server key - ecryption secret
optional parameters: timeout, port
timeout - tcp timeout port - tcp port
- close()
-
Close socket connection.
- init_tacacs_session()
-
Inititalize socket connection to tacacs server.
- errmsg()
-
Returns latest error message
- authenticate(username, password, authen_type)
-
username - tacacs+ username password - tacacs+ user password authen_type - TAC_PLUS_AUTHEN_TYPE_ASCII | TAC_PLUS_AUTHEN_TYPE_PAP
-
username - tacacs+ username args - tacacs+ authorization arguments
- account(username, args)
-
username - tacacs+ username args - tacacs+ authorization arguments flags - optional: tacacs+ accounting flags default: TAC_PLUS_ACCT_FLAG_STOP
COPYRIGHT AND LICENSE
Copyright (C) 2006 by Jozef Kutej
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.