CGI::A...cation(3pm)
π CGI::Application::Plugin::Authentication(3pm) π
okay so this page is from the User Contributed Perl Documentation crew, and the manual name is CGI::Application::Plugin::Authentication(3pm). Bestie, it's giving authentication-framework-for-CGI::Application realness, and we're gonna go through every single detail together. No skips, no vibes-based summarising, periodt. π
πΈ NAME πΈ
CGI::Application::Plugin::Authentication β authentication framework for CGI::Application, aka the plugin that helps your app know who's who. π
β¨ SYNOPSIS β¨
package MyCGIApp;
use base qw(CGI::Application); # make sure this occurs before you load the plugin
use CGI::Application::Plugin::Authentication;
MyCGIApp->authen->config(
DRIVER => [ 'Generic', { user1 => '123' } ],
);
MyCGIApp->authen->protected_runmodes('myrunmode');
sub myrunmode {
my $self = shift;
# The user should be logged in if we got here
my $username = $self->authen->username;
}
like, that's the whole vibe: load the plugin after CGI::Application, configure a driver, protect a runmode, and then inside that runmode you can grab $self->authen->username. iconic. π
π¦ DESCRIPTION π¦
CGI::Application::Plugin::Authentication adds the ability to authenticate users in your CGI::Application modules. It imports one method called authen into your CGI::Application module. Through the authen method you can call all the methods of the CGI::Application::Plugin::Authentication plugin. fr fr, that one method is your main character. π
There are two main decisions that you need to make when using this module:
- How will the usernames and passwords be verified (i.e. from a database, LDAP, etc...)?
- How can we keep the knowledge that a user has already logged in persistent, so that they will not have to enter their credentials again on the next request (i.e. how do we 'Store' the authentication information across requests)?
lowkey those two choices are the whole plot. π
π§ Choosing a Driver π§
There are three drivers that are included with the distribution. Also, there is built in support for all of the Authen::Simple modules (search CPAN for Authen::Simple for more information). This should be enough to cover everyone's needs.
If you need to authenticate against a source that is not provided, you can use the Generic driver which will accept either a hash of username/password pairs, or an array of arrays of credentials, or a subroutine reference that can verify the credentials. So through the Generic driver you should be able to write your own verification system. There is also a Dummy driver, which blindly accepts any credentials (useful for testing). See the CGI::Application::Plugin::Authentication::Driver::Generic, CGI::Application::Plugin::Authentication::Driver::DBI and, CGI::Application::Plugin::Authentication::Driver::Dummy docs for more information on how to use these drivers. And see the Authen::Simple suite of modules for information on those drivers.
ngl, Generic and Dummy are the DIY besties of this section. π οΈ
π Choosing a Store π
The Store modules keep information about the authentication status of the user persistent across multiple requests. The information that is stored in the store include the username, and the expiry time of the login. There are two Store modules included with this distribution. A Session based store, and a Cookie based store. If your application is already using Sessions (through the CGI::Application::Plugin::Session module), then I would recommend that you use the Session store for authentication. If you are not using the Session plugin, then you can use the Cookie store. The Cookie store keeps all the authentication in a cookie, which contains a checksum to ensure that users can not change the information.
If you do not specify which Store module you wish to use, the plugin will try to determine the best one for you.
the way that Store modules just keep the logged-in knowledge alive between requests? obsessed. πͺ
π Login page π
The Authentication plugin comes with a default login page that can be used if you do not want to create a custom login page. This login form will automatically be used if you do not provide either a LOGIN_URL or LOGIN_RUNMODE parameter in the configuration. If you plan to create your own login page, I would recommend that you start with the HTML code for the default login page, so that your login page will contain the correct form fields and hidden fields.
like, please don't hand-roll the form fields and forget the hidden ones. the default page is right there, bestie. π
π Ticket based authentication π
This Authentication plugin can handle ticket based authentication systems as well. All that is required of you is to write a Store module that can understand the contents of the ticket. The Authentication plugin will require at least the 'username' to be retrieved from the ticket. A Ticket based authentication scheme will not need a Driver module at all, since the actual verification of credentials is done by an external authentication system, possibly even on a different host. You will need to specify the location of the login page using the LOGIN_URL configuration variable, and unauthenticated users will automatically be redirected to your ticket authentication login page.
ticket-based auth said "no Driver, I'm external, I'm mysterious." main character energy, honestly. ποΈπ
π« EXPORTED METHODS π«
π authen π
This is the only method exported from this module. Everything is controlled through this method call, which will return a CGI::Application::Plugin::Authentication object, or just the class name if called as a class method. When using the plugin, you will always first call $self->authen or __PACKAGE__->authen and then the method you wish to invoke. For example:
__PACKAGE__->authen->config(
LOGIN_RUNMODE => 'login',
);
- or -
$self->authen->protected_runmodes(qw(one two));
one exported method to rule them all, and honestly? slay. π«Ά
π οΈ METHODS π οΈ
βοΈ config βοΈ
This method is used to configure the CGI::Application::Plugin::Authentication module. It can be called as an object method, or as a class method. Calling this function, will not itself generate cookies or session ids.
just to be super clear: calling config does not, by itself, generate cookies or session ids. it configures. that's the whole job. π
The following parameters are accepted:
π₯ DRIVER π₯
Here you can choose which authentication module(s) you want to use to perform the authentication. For simplicity, you can leave off the CGI::Application::Plugin::Authentication::Driver:: part when specifying the DRIVER name. If this module requires extra parameters, you can pass an array reference that contains as the first parameter the name of the module, and the rest of the values in the array will be considered options for the driver. You can provide multiple drivers which will be used, in order, to check the credentials until a valid response is received.
DRIVER => 'Dummy' # let anyone in regardless of the password
- or -
DRIVER => [ 'DBI',
DBH => $self->dbh,
TABLE => 'user',
CONSTRAINTS => {
'user.name' => '__CREDENTIAL_1__',
'MD5:user.password' => '__CREDENTIAL_2__'
},
],
- or -
DRIVER => [
[ 'Generic', { user1 => '123' } ],
[ 'Generic', sub { my ($u, $p) = @_; is_prime($p) ? 1 : 0 } ]
],
- or -
DRIVER => [ 'Authen::Simple::LDAP',
host => 'ldap.company.com',
basedn => 'ou=People,dc=company,dc=net'
],
multiple drivers get checked in order until one gives a valid response, which is lowkey a vibe check for credentials. π
πͺ STORE πͺ
Here you can choose how we store the authenticated information after a user has successfully logged in. We need to store the username so that on the next request we can tell the user has already logged in, and we do not have to present them with another login form. If you do not provide the STORE option, then the plugin will look to see if you are using the CGI::Application::Plugin::Session module and based on that info use either the Session module, or fall back on the Cookie module. If the module requires extra parameters, you can pass an array reference that contains as the first parameter the name of the module, and the rest of the array should contain key value pairs of options for this module. These storage modules generally live under the CGI::Application::Plugin::Authentication::Store:: name-space, and this part of the package name can be left off when specifying the STORE parameter.
STORE => 'Session'
- or -
STORE => ['Cookie',
NAME => 'MYAuthCookie',
SECRET => 'FortyTwo',
EXPIRY => '1d',
]
the Store is literally the memory of "bestie already logged in" across requests. π§ β¨
π POST_LOGIN_RUNMODE π
Here you can specify a runmode that the user will be redirected to if they successfully login.
POST_LOGIN_RUNMODE => 'welcome'
successful login and then straight to welcome? cute. π
π POST_LOGIN_URL π
Here you can specify a URL that the user will be redirected to if they successfully login. If both POST_LOGIN_URL and POST_LOGIN_RUNMODE are specified, then the latter will take precedence.
POST_LOGIN_URL => 'http://example.com/start.cgi'
so if you set both, POST_LOGIN_RUNMODE wins. noted. π
π«Ά POST_LOGIN_CALLBACK π«Ά
A code reference that is executed after login processing but before POST_LOGIN_RUNMODE or redirecting to POST_LOGIN_URL. This is normally a method in your CGI::Application application and as such the CGI::Application object is passed as a parameter.
POST_LOGIN_CALLBACK => \&update_login_date
and later in your code:
sub update_login_date {
my $self = shift;
return unless($self->authen->is_authenticated);
...
}
this is your little "after login, before redirect" moment. do with it what you will. πͺ
π LOGIN_RUNMODE π
Here you can specify a runmode that the user will be redirected to if they need to login.
LOGIN_RUNMODE => 'login'
πͺ LOGIN_URL πͺ
If your login page is external to this module, then you can use this option to specify a URL that the user will be redirected to when they need to login. If both LOGIN_URL and LOGIN_RUNMODE are specified, then the latter will take precedence.
LOGIN_URL => 'http://example.com/login.cgi'
again: if both are set, LOGIN_RUNMODE takes precedence. no cap. β‘
π LOGOUT_RUNMODE π
Here you can specify a runmode that the user will be redirected to if they ask to logout.
LOGOUT_RUNMODE => 'logout'
πͺπ¨ LOGOUT_URL πͺπ¨
If your logout page is external to this module, then you can use this option to specify a URL that the user will be redirected to when they ask to logout. If both LOGOUT_URL and LOGOUT_RUNMODE are specified, then the latter will take precedence.
here's the example exactly as it appears:
LOGIN_URL => 'http://example.com/logout.html'
yes, the example literally uses LOGIN_URL there. keeping it character for character, bestie. π
π§Ό DETAINT_URL_REGEXP π§Ό
This is a regular expression used to detaint URLs used in the login form. By default it will be set to
^([\w\_\%\?\&\;\-\/\@\.\+\$\=\#\:\!\*\"\'\(\)\,]+)$
This regular expression is based upon the document http://www.w3.org/Addressing/URL/url-spec.txt. You could set it to a more specific regular expression to limit the domains to which users could be directed.
detainting URLs: important, not boring. do not skip the regex. π§Όβ¨
π§Ό DETAINT_USERNAME_REGEXP π§Ό
This is a regular expression used to detaint the username parameter used in the login form. By default it will be set to
^([\w\_]+)$
and that's the username detaint default, exactly as written. π
CREDENTIALS πβ¨
Okay so this one is the vibe check for where your login fields live. Set this to the list of form fields where the user will type in their username and password. By default itβs set to ['authen_username', 'authen_password']. The form field names should be set to a value that you are not likely to use in any other forms.
This is important because this plugin will automatically look for query parameters that match these values on every request to see if a user is trying to log in. So if you use the same parameter names on a user management page, you may inadvertently perform a login when that was not intended. No cap, itβs giving βoops, accidental main character loginβ π
Most of the Driver modules will return the first CREDENTIAL as the username, so make sure that you list the username field first. This option can be ignored if you use the built in login box.
CREDENTIALS => 'authen_password'
- or -
CREDENTIALS => [ 'authen_username', 'authen_domain', 'authen_password' ]
LOGIN_SESSION_TIMEOUT β°π
This option can be used to tell the system when to force the user to re-authenticate. There are a few different possibilities that can all be used concurrently:
IDLE_FORβ If this value is set, a re-authentication will be forced if the user was idle for more then x amount of time.EVERYβ If this value is set, a re-authentication will be forced every x amount of time.CUSTOMβ This value can be set to a subroutine reference that returns true if the session should be timed out, and false if it is still active. This can allow you to be very selective about how the timeout system works. The authen object will be passed in as the only parameter.
Time values are specified in seconds. You can also specify the time by using a number with the following suffixes (m h d w), which represent minutes, hours, days and weeks. The default is 0 which means the login will never timeout.
Heads up, bestie: the login is also dependent on the type of STORE that is used. If the Session store is used, and the session expires, then the login will also automatically expire. The same goes for the Cookie store. πͺ
For backwards compatibility, if you set LOGIN_SESSION_TIMEOUT to a time value instead of a hashref, it will be treated as an IDLE_FOR time out.
# force re-authentication if idle for more than 15 minutes
LOGIN_SESSION_TIMEOUT => '15m'
# Everyone must re-authentication if idle for more than 30 minutes
# also, everyone must re-authentication at least once a day
# and root must re-authentication if idle for more than 5 minutes
LOGIN_SESSION_TIMEOUT => {
IDLE_FOR => '30m',
EVERY => '1d',
CUSTOM => sub {
my $authen = shift;
return ($authen->username eq 'root' && (time() - $authen->last_access) > 300) ? 1 : 0;
}
}
RENDER_LOGIN π¨π¦
This value can be set to a subroutine reference that returns the HTML of a login form. The subroutine reference overrides the default call to login_box. The subroutine is normally a method in your CGI::Application application and as such the CGI::Application object is passed as the first parameter.
RENDER_LOGIN => \&login_form
and later in your code:
sub login_form {
my $self = shift;
...
return $html
}
LOGIN_FORM ππ
You can set this option to customize the login form that is created when a user needs to be authenticated. If you wish to replace the entire login form with a completely custom version, then just set LOGIN_RUNMODE to point to your custom runmode.
All of the parameters listed below are optional, and a reasonable default will be used if left blank:
DISPLAY_CLASS(default:Classic) β the class used to display the login form. The alternative is"Basic"which aims for XHTML compliance and leaving style to CSS. SeeCGI::Application::Plugin::Authentication::Displayfor more details.TITLE(default:Sign In) β the heading at the top of the login box.USERNAME_LABEL(default:User Name) β the label for the user name input.PASSWORD_LABEL(default:Password) β the label for the password input.SUBMIT_LABEL(default:Sign In) β the label for the submit button.COMMENT(default:Please enter your username and password in the fields below.) β a message provided on the first login attempt.REMEMBERUSER_OPTION(default:1) β provide a checkbox to offer to remember the users name in a cookie so that their user name will be pre-filled the next time they log in.REMEMBERUSER_LABEL(default:Remember User Name) β the label for the remember user name checkbox.REMEMBERUSER_COOKIENAME(default:CAPAUTHTOKEN) β the name of the cookie where the user name will be saved.REGISTER_URL(default:<none>) β the URL for the register new account link.REGISTER_LABEL(default:Register Now!) β the label for the register new account link.FORGOTPASSWORD_URL(default:<none>) β the URL for the forgot password link.FORGOTPASSWORD_LABEL(default:Forgot Password?) β the label for the forgot password link.INVALIDPASSWORD_MESSAGE(default:Invalid username or password<br />(login attempt %d)) β a message given when a login failed.INCLUDE_STYLESHEET(default:1) β use this to disable the built in style-sheet for the login box so you can provide your own custom styles.FORM_SUBMIT_METHOD(default:post) β use this to get the form to submit using'get'instead of'post'.FOCUS_FORM_ONLOAD(default:1) β use this to automatically focus the login form when the page loads so a user can start typing right away.BASE_COLOUR(default:#445588) β This is the base colour that will be used in the included login box. All other colours are automatically calculated based on this colour (unless you hardcode the colour values). In order to calculate other colours, you will need theColor::Calcmodule. If you do not have theColor::Calcmodule, then you will need to use fixed values for all of the colour options. All colour values besides theBASE_COLOURcan be simple percentage values (including the%sign). For example if you set theLIGHTER_COLOURoption to80%, then the calculated colour will be80%lighter than theBASE_COLOUR.LIGHT_COLOUR(default:50%or#a2aac4) β A colour that is lighter than the base colour.LIGHTER_COLOUR(default:75%or#d0d5e1) β A colour that is another step lighter than the light colour.DARK_COLOUR(default:30%or#303c5f) β A colour that is darker than the base colour.DARKER_COLOUR(default:60%or#1b2236) β A colour that is another step darker than the dark colour.GREY_COLOUR(default:#565656) β A grey colour that is calculated by desaturating the base colour.
protected_runmodes π‘οΈπ
This method takes a list of runmodes that are to be protected by authentication. If a user tries to access one of these runmodes, then they will be redirected to a login page unless they are properly logged in. The runmode names can be a list of simple strings, regular expressions, or special directives that start with a colon. This method is cumulative, so if it is called multiple times, the new values are added to existing entries. It returns a list of all entries that have been saved so far. Calling this function, will not itself generate cookies or session ids. πͺπ«
:allβ All runmodes in this module will require authentication.
# match all runmodes
__PACKAGE__->authen->protected_runmodes(':all');
# only protect runmodes one two and three
__PACKAGE__->authen->protected_runmodes(qw(one two three));
# protect only runmodes that start with auth_
__PACKAGE__->authen->protected_runmodes(qr/^auth_/);
# protect all runmodes that *do not* start with public_
__PACKAGE__->authen->protected_runmodes(qr/^(?!public_)/);
is_protected_runmode ππ
This method accepts the name of a runmode, and will tell you if that runmode is a protected runmode (i.e. does a user need to be authenticated to access this runmode). Calling this function, will not itself generate cookies or session ids. Itβs literally just the βis this locked?β check, bestie. π
redirect_after_login πβ¨
This method is called during the prerun stage to redirect the user to the page that has been configured as the destination after a successful login. The location is determined as follows:
POST_LOGIN_RUNMODEβ If thePOST_LOGIN_RUNMODEconfig parameter is set, that run mode will be the chosen location.POST_LOGIN_URLβ If the above fails and thePOST_LOGIN_URLconfig parameter is set, then there will be a302redirection to that location.destinationβ If the above fails and there is adestinationquery parameter, which must a taint check against theDETAINT_URL_REGEXPconfig parameter, then there will be a302redirection to that location.original destinationβ If all the above fail then there the originally requested page will be delivered.
redirect_to_login ππ«Ά
This method is called during the prerun stage if the current user is not logged in, and they are trying to access a protected runmode. It will redirect to the page that has been configured as the login page, based on the value of LOGIN_RUNMODE or LOGIN_URL. If nothing is configured a simple login page will be automatically provided. Slay, automatic backup plan. π
redirect_to_logout ππΈ
This method is called during the prerun stage if the user has requested to be logged out. It will redirect to the page that has been configured as the logout page, based on the value of LOGOUT_RUNMODE or LOGOUT_URL. If nothing is configured, the page will redirect to the website homepage. Bye bestie, iconic exit. β¨
setup_runmodes π§©π
This method is called during the prerun stage to register some custom runmodes that the Authentication plugin requires in order to function. Calling this function, will not itself generate cookies or session ids.
last_login π°οΈπ
This will return the time of the last login for this user.
my $last_login = $self->authen->last_login;
This function will initiate a session or cookie if one has not been created already.
last_access β±οΈπ¦
This will return the time of the last access for this user.
my $last_access = $self->authen->last_access;
Okay so pulling up right where we left off, bestie: this function will initiate a session or cookie if one hasn't been created already. π
is_login_timeout
This one hands you true or false depending on whether the user's login status just timed out. π Like:
$self->add_message('login session timed out') if $self->authen->is_login_timeout;
And yep: this function will initiate a session or cookie if one hasn't been created already. π«Ά
is_authenticated
Returns true or false depending on this user's login status. periodt.
assert($self->authen->is_authenticated); # The user should be logged in if we got here
Same reminder: this function will initiate a session or cookie if one hasn't been created already. β¨
login_attempts
This method returns the number of failed login attempts this user has made since the last successful login. β οΈ Lowkey important: this is not a number that can be trusted, because it depends on the underlying store being able to return the correct value for this user. For example, if the store uses a cookie-based session, the user trying to log in could delete their cookies and get a brand-new session with no login attempts listed. The number gets cleared on a successful login. And yes β this function will initiate a session or cookie if one hasn't been created already. π
username
Returns the username of the currently logged-in user, or undef if no user is currently logged in. π
my $username = $self->authen->username;
This function will initiate a session or cookie if one hasn't been created already. π
is_new_login
Returns true or false depending on whether this is a fresh login. π
$self->log->info("New Login") if $self->authen->is_new_login;
This function will initiate a session or cookie if one hasn't been created already. πΈ
credentials
Returns the names of the form parameters that will be looked for during a login. By default those are authen_username and authen_password, but you can change them by supplying the CREDENTIALS parameters in the configuration. Vibe check: calling this function will not itself generate cookies or session ids. π
logout
Attempts to log the user out. If during a request the Authentication module sees a parameter called 'authen_logout', it will automatically call this method to log out the user. π
$self->authen->logout();
This function will initiate a session or cookie if one hasn't been created already. π¦
drivers
Returns a list of driver objects that are used for verifying the login credentials. And ngl, calling this function will not itself generate cookies or session ids. β
store
Returns a store object that is used to store information about the status of the authentication across multiple requests. This function will initiate a session or cookie if one hasn't been created already. π
initialize
This one does most of the heavy lifting for the Authentication plugin. ποΈ It checks to see if the user is currently attempting to log in by looking for the credential form fields in the query object. It loads the required driver objects and authenticates the user. It is OK to call this method multiple times β it checks to see if it has already been executed and will just return without doing anything if called multiple times. That lets us call initialize as late as possible in the request so no unnecessary work is done. π₯
The user will be logged out by calling the logout() method if the login session has been idle for too long, if it has been too long since the last login, or if the login has timed out. If you need to know if a user was logged out because of a time out, you can call the "is_login_timeout" method. π
If all goes well, a true value will be returned, although it is usually not necessary to check. β¨
This function will initiate a session or cookie if one hasn't been created already. π«Ά
display
Returns the CGI::Application::Plugin::Authentication::Display object, creating and caching it if necessary. π
login_box
Returns the HTML for a login box that can be embedded into another page. This is the same login box that is used in the default authen_login runmode that the plugin provides. π
This function will initiate a session or cookie if one hasn't been created already. π
new
Creates a new CGI::Application::Plugin::Authentication object. It requires, as its only parameter, a CGI::Application object. Do not call this method directly β the 'authen' method that is imported into the CGI::Application module will take care of creating the CGI::Application::Plugin::Authentication object when it is required. Calling this function will not itself generate cookies or session ids. π
instance
Works the same way as 'new', except that it returns the same Authentication object for the duration of the request. Also do not call this method directly β again, the 'authen' method that is imported into the CGI::Application module takes care of creating the CGI::Application::Plugin::Authentication object when it is required. Calling this function will not itself generate cookies or session ids. π
π¦ CGI::Application CALLBACKS π¦
prerun_callback
This method is a CGI::Application prerun callback that will be automatically registered for you if you are using CGI::Application 4.0 or greater. π¦ If you are using an older version of CGI::Application, you will have to create your own cgiapp_prerun method and make sure you call this method from there. Like so:
sub cgiapp_prerun {
my $self = shift;
$self->CGI::Application::Plugin::Authentication::prerun_callback();
}
π₯ CGI::Application RUNMODES π₯
authen_login_runmode
This runmode is provided if you do not want to create your own login runmode. It will display a simple login form for the user, which can be replaced by assigning RENDER_LOGIN a coderef that returns the HTML. π
authen_dummy_redirect
This runmode is provided for convenience when an external redirect needs to be done. It just returns an empty string. π
π EXAMPLE π
In a CGI::Application module:
use base qw(CGI::Application);
use CGI::Application::Plugin::AutoRunmode;
use CGI::Application::Plugin::Session;
use CGI::Application::Plugin::Authentication;
__PACKAGE__->authen->config(
DRIVER => [ 'Generic', { user1 => '123' } ],
STORE => 'Session',
LOGOUT_RUNMODE => 'start',
);
__PACKAGE__->authen->protected_runmodes(qr/^auth_/, 'one');
sub start : RunMode {
my $self = shift;
}
sub one : RunMode {
my $self = shift;
# The user will only get here if they are logged in
}
sub auth_two : RunMode {
my $self = shift;
# This is also protected because of the
# regexp call to protected_runmodes above
}
π COMPATIBILITY WITH CGI::Application::Plugin::ActionDispatch π
The prerun callback has been modified so that it will check for the presence of a prerun mode. This is for compatibility with CGI::Application::Plugin::ActionDispatch. This change should be considered experimental. β οΈ It is necessary to load the ActionDispatch module so that the two prerun callbacks will be called in the correct order. π₯
π RECOMMENDED USAGE π
CSS
The best practice nowadays is generally considered to be to not have CSS embedded in HTML. Thus it should be best to set LOGIN_FORM -> DISPLAY_CLASS to 'Basic'. π
Post login destination
Of the various means of selecting a post login destination, the most secure would seem to be POST_LOGIN_URL. The "destination" parameter could potentially be hijacked by hackers. π The POST_LOGIN_RUNMODE parameter requires a hidden parameter that could potentially be hijacked. π
Taint mode
Do run your code under taint mode. It should help protect your application against a number of attacks. π‘οΈ
URL and username checking
Please set the "DETAINT_URL_REGEXP" and "DETAINT_USERNAME_REGEXP" parameters as tightly as possible. In particular, you should prevent the destination parameter being used to redirect authenticated users to external sites β unless of course that is what you want, in which case that site should be the only possible external site. π
The login form
The HTML currently generated does not seem to be standards compliant as per RT bug 58023. Also, the default login form includes hidden forms which could conceivably be hijacked. Set LOGIN_FORM -> DISPLAY_CLASS to 'Basic' to fix this. π
π TODO π
There are lots of things that can still be done to improve this plugin. If anyone else is interested in helping out, feel free to dig right in. Many of these things don't need my input, but if you want to avoid duplicated efforts, send me a note, and I'll let you know if anyone else is working in the same area. π«Ά
- review the code for security bugs and report
- complete the separation of presentation and logic
- write a tutorial
- build more Drivers (
Class::DBI,LDAP,Radius, etc...) - Add support for method attributes to identify runmodes that require authentication
- finish the test suite
- provide more example code
- clean up the documentation
- build a DB driver that builds it's own table structure. This can be used by people that don't have their own user database to work with, and could include a simple user management application.
π BUGS π
This is alpha software and as such, the features and interface are subject to change. So please check the Changes file when upgrading. β οΈ
Some of the test scripts appear to be incompatible with versions of Devel::Cover later than 0.65. π
π SEE ALSO π
CGI::Application, perl(1)
βοΈ AUTHOR βοΈ
Author: Cees Hek <ceeshek@gmail.com>; Co-maintainer: Nicholas Bamber <nicholas@periapt.co.uk>. π
π CREDITS π
Thanks to SiteSuite <http://www.sitesuite.com.au> for funding the development of this plugin and for releasing it to the world. π
Thanks to Christian Walde for suggesting changes to fix the incompatibility with CGI::Application::Plugin::ActionDispatch and for help with github. π«Ά
Thanks to Alexandr Ciornii for pointing out some typos. β¨
π LICENCE AND COPYRIGHT π
Copyright (c) 2005, SiteSuite. All rights reserved. Copyright (c) 2010, Nicholas Bamber. (Portions of the code).
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π
The background images in the default login forms are used courtesy of www.famfamfam.com <http://www.famfamfam.com/lab/icons/silk/>. Those icons are issued under the Creative Commons Attribution 3.0 License <http://creativecommons.org/licenses/by/3.0/>. Those icons are copyrighted 2006 by Mark James <mjames at gmail dot com>. π
π DISCLAIMER OF WARRANTY π
okay bestie, this is the part where the lawyers take the mic π€ and honestly? you need to read it, because it's the whole "we gave you this for free, so pls don't sue us" chapter of the story. no cap, it's giving serious, but it's also giving important. sit with it, fr fr.
Clause one β it's free, so there's no warranty
Because this software is licensed free of charge, there is no warranty for the software β to the extent permitted by applicable law. That's the deal. π
Clause two β "AS IS", capital letters, no takebacks
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. like. all of them. every warranty. gone. β¨
Clause three β the risk is yours, bestie
The entire risk as to the quality and performance of the software is with you. not them. you. π«Ά
Clause four β if it breaks, that's a you-problem (financially)
Should the software prove defective, you assume the cost of all necessary servicing, repair, or correction. π yeah. that one stings a little.
Clause five β the big no-liability one, read it twice
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. and yes, that includes, but is not limited to:
- loss of data
- data being rendered inaccurate
- losses sustained by you or third parties
- a failure of the software to operate with any other software
β¦and that's true even if such holder or other party has been advised of the possibility of such damages. so like, even if you warned them it was gonna blow up π β still no liability. periodt.
tl;dr for the girlies in the back: it's free, it's "AS IS", the risk is yours, and nobody upstream is paying for your damages. that's the whole vibe check. π
okay that's a wrap on the whole page, bestie!! π you made it to the very end, iconic behavior honestly π β this was perl v5.38.2, dated 2024-06-29, and the page you just read all the way through is CGI::A...cation(3pm). go build something cute with it πΈπ¦β¨
π¦ where this page comes from
- debian trixie: libcgi-application-plugin-authentication-perl 0.25+~cs0.5-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-authentication-perl 0.25+~cs0.5-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-authentication-perl 0.25+~cs0.5-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms