News::Web::CookieAuth - authentication for News::Web via cookies
use News::Web::CookieAuth; use CGI; my $cookie = CGI->cookie('nntpauthinfo') || ""; my $authinfo = News::Web::CookieAuth->new($cookie);
See 'setcookie.cgi' for a fairly comprehensive tutorial.
This documentation is far from complete. However, the module itself is just meant to be glue; if you're using it, you can probably spend some time and work out how it works.
The cookie itself contains these fields:
nntpuser The NNTP user to connect to the server as nntppass The NNTP password, in clear text (these things are generally passed in cleartext anyway, and so shouldn't be considered secure in the first place realname The user's real name (half of the From: heaer) emailadd The user's email address (half of the From: heaer) signature The user's signature file version Not currently used, but useful if we decide to use different versions of the cookie.
Creates the News::Web::CookieAuth object, based on the string COOKIE. If not passed, then you can later add it with read_cookie().
COOKIE
Reads or manipulates the given field. If DATA is passed, sets the field as appropriate; either way, it returns the value of the field.
DATA
Returns or manipulates the cookie itself, as above. Not as good an idea to do this, since without read_cookie() the other values are not manipulated.
Reads the specific FIELD.
FIELD
Reads the information from COOKIE (defaults to the value of cookie()) into the object.
Returns a hash of the fields stored in the object.
Returns either either a hashref (when invoked in scalar context) or the hash itself.
CGI.pm
CGI.pm, News::Web
This is hardly the ideal form of authentication; however, it's a lot simpler to implement generally than a database-backed solution would be. This doesn't change the fact that I'd rather use the database-backed solution in the future, though, which is why this module is fairly general and could be re-implemented as some other class...
Tim Skirvin <tskirvin@killfile.org>
Copyright 2003 by Tim Skirvin <tskirvin@killfile.org>. This code may be distributed under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
You forgot a '=back' before '=head1'
To install News::Web, copy and paste the appropriate command in to your terminal.
cpanm
cpanm News::Web
CPAN shell
perl -MCPAN -e shell install News::Web
For more information on module installation, please visit the detailed CPAN module installation guide.