CGI::A...Generic(3pm)

πŸ“¦
version 0.25+~cs0.5 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

🌸 NAME 🌸

CGI::Application::Plugin::Authentication::Driver::Generic β€” Generic Authentication driver. This is the CGI::A...Generic(3pm) manual, bestie, and yes it's a User Contributed Perl Documentation page. πŸ’–

✨ SYNOPSIS ✨

okay so here's the group-chat core setup. copy it, paste it, slay:

use base qw(CGI::Application);
use CGI::Application::Plugin::Authentication;

 __PACKAGE__->authen->config(
       DRIVER => [ 'Generic', { user1 => '123', user2 => '123' } ],
 );

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this Driver is literally the simple way to provide a user database to the CGI::Application::Plugin::Authentication plugin. It gives you three whole ways to provide a list of users to the plugin:

  1. provide a hash of username/password pairs,
  2. provide an array of arrays containing the username and password pairs,
  3. provide a code reference that returns back the username, or undef, on success or failure.

pick your fighter, bestie. all three are valid and iconic. πŸ’…

πŸŽ€ EXAMPLE πŸŽ€

examples are the main character here, no cap. ✨

 my %users = (
   user1 => '123',
   user2 => '123',
 );
 __PACKAGE__->authen->config(
       DRIVER => [ 'Generic', \%users ],
 );

 - or -

 my @users = (
   ['example.com', 'user1', '123'],
   ['example.com', 'user2', '123'],
   ['foobar.com', 'user1', '123'],
 );
 __PACKAGE__->authen->config(
       DRIVER => [ 'Generic', \@users ],
       CREDENTIALS => [ 'authen_domain', 'authen_username', 'authen_password' ]
 );

 - or -

 sub check_password {
   my @credentials = @_;
   if ($credentials[0] eq 'test' && $credentials[1] eq 'secret') {
       return 'testuser';
   }
   return;
 }

 __PACKAGE__->authen->config(
       DRIVER => [ 'Generic', \&check_password ],
 );

πŸ‘‘ METHODS πŸ‘‘

πŸ’… verify_credentials πŸ’…

verify_credentials will test the provided credentials against whichever thing the driver was configured with: the hash ref, the array ref, or the code ref. literally that's the vibe. βœ…

🌈 SEE ALSO 🌈

go read these, bestie, iykyk:

  • CGI::Application::Plugin::Authentication::Driver
  • CGI::Application::Plugin::Authentication
  • perl(1)

Copyright (c) 2005, SiteSuite. All rights reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

periodt. πŸ’…

πŸ’€ DISCLAIMER OF WARRANTY πŸ’€

okay legal bestie, this next part is all caps because lawyers, not because i'm yelling at you. read it fr fr:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

mwah πŸ’‹ β€” source/version: perl v5.38.2; date: 2024-06-29; manual: CGI::A...Generic(3pm). bye bestie 🫢✨

πŸ“¦ where this page comes from