AIS::client - get an authenticated e-mail address for users of your web service
BEGIN{umask(0077 & umask())}; # if your web server gives you a 0177 umask use AIS::client; print "Content-type: text/plain\n\nWelcome $AIS_IDENTITY\n"; print "this is page view number ", ++$AIS_STASH{accesses}; __END__
The goal of AIS::client is to provide a very easy way to require an authenticated identity for a perl web application. The user's e-mail address appears in a global variable $AIS_IDENTITY and a persistent session stash is available in %AIS_STASH.
$AIS_IDENTITY
%AIS_STASH
By default, AIS::client will refer to the AIS service defined at http://www.pay2send.com/cgi/ais/ but an alternate AIS service can be specified with the aissri parameter:
aissri
use AIS::client aissri => 'http://www.cpan.org/service/ais/';
By default, AIS::client will give the URL of the webpage being requested as the agent string, but an alternate agent string can be specified with the agent parameter:
agent
use AIS::client aissri => "Bob's web services: account MZNXBCV";
It is expected that a subscription-based or otherwise access-controlled AIS service might issue expiring capability keys which would have to be listed as part of the agent string.
By default, AIS, which means that AIS::client will store session data (incliding identity, which is also available as $AIS_STASH{identity}) in subdirectories under a directory called AIS_sessions under the current directory your script runs in. This can be changed with the prefix parameter:
AIS
$AIS_STASH{identity}
AIS_sessions
prefix
use AIS::client prefix => '.AIS'; # hide session directory
The prefix is also used as the prefix for the session cookie name, which defaults to AIS_session.
AIS_session
By default, AIS::client will examine the session directory for stale sessions approximately once every 2000 invocations. Adjust this with the freq parameter. 0 will suppress housekeeping entirely.
freq
0
Minimum time in seconds since $AIS_STASH{last_access} that will trigger session deletion at housekeeping time. Defaults to 72*60*60.
$AIS_STASH{last_access}
72*60*60
AIS::client recognizes a reserved QUERY_STRING of LOGOUT which will end a session, delete all session data, and offer the user a link to the logout function of the specified AIS server so they can log out of that too if they want.
LOGOUT
This is the first public AIS client module release with this interface, which is entirely different from the CGI::AIS::Session interface.
fixed the Makefile.pl to call in DirDB
installation problems due to permissions now go to the web browser instead of silently dying. redirections now done with more portable REFRESH meta tags instead of (along with) less portable Location: headers
please use rt.cpan.org to report problems (and successes!) (And wishes!)
David Nicol <davidnico@cpan.org>
CGI::Session::Auth does something very similar.
CGI::AIS::Session is now deprecated and replaced.
2 POD Errors
The following errors were encountered while parsing the POD:
'=item' outside of any '=over'
You forgot a '=back' before '=head1'
To install AIS::client, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AIS::client
CPAN shell
perl -MCPAN -e shell install AIS::client
For more information on module installation, please visit the detailed CPAN module installation guide.