Authen...::CDBI(3pm)

πŸ“¦
version 0.2 Β· 2 versions
  • 0.2 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.2 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ 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 🫢


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 πŸŒΈπŸ’–πŸ¦‹