Authen...::CDBI(3pm)
β¨ Authen::Simple::CDBI β¨
okay bestie, sit down, hydrate, and let me tell you about Authen::Simple::CDBI π β it's the 3pm manual page for a little module that does Class::DBI authentication. Simple. Clean. Iconic. It's giving "I just want to log someone in, please stop making it weird." π
πΈ NAME πΈ
Authen::Simple::CDBI β literally just Simple Class::DBI authentication, no notes π
π¦ SYNOPSIS π¦
here's the vibe, copy-paste core π«Ά
use Authen::Simple::CDBI;
my $cdbi = Authen::Simple::CDBI->new(
class => 'MyApp::Model::User'
);
if ( $cdbi->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::CDBI
PerlSetVar AuthenSimpleDBI_class "MyApp::Model::User"
<Location /protected>
PerlAuthenHandler Authen::Simple::CDBI
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
bestie the PerlSetVar AuthenSimpleDBI_class line is exactly what the page says, so don't go "fixing" it, okay? copy it character for character or it's not gonna hit the same π
π DESCRIPTION π
Class::DBI authentication. that's the whole description. short queen. she said what she said π
π METHODS π
π new
this method takes a hash of parameters, and honestly the options are:
classβ your Class::DBI subclass. Required. like, you genuinely cannot skip this one, it's the main character β¨
class => 'MyApp::Model::User'
usernameβ the name of your "username" column. defaults to"username"π
username => 'username'
passwordβ the name of your "password" column. defaults to"password"π
password => 'password'
logβ any object that supports"debug","info","error"and"warn"π
log => Log::Log4perl->get_logger('Authen::Simple::CDBI')
π authenticate( $username, $password )
returns true on success and false on failure. that's it. that's the whole contract. she's not complicated, she's just correct π
π SEE ALSO π
Authen::Simple.Authen::Simple::Password.Class::DBI.
go read them, iykyk πβ¨
π AUTHOR π
Christian Hansen ch@ngmedia.com β thank you for your service, legend π«Ά
β COPYRIGHT β
this program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. slay, open source queen π
perl v5.34.0 Β· 2022-06-08 β that's the version and date this page shipped with, mwah, go forth and authenticate responsibly πΈππ¦
π¦ where this page comes from
- debian bookworm: libauthen-simple-cdbi-perl 0.2-4
- debian trixie: libauthen-simple-cdbi-perl 0.2-4
- ubuntu noble: libauthen-simple-cdbi-perl 0.2-4
- ubuntu resolute: libauthen-simple-cdbi-perl 0.2-4
- ubuntu stonking: libauthen-simple-cdbi-perl 0.2-4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms