Authen...rectory(3pm)
πΈ NAME πΈ
Authen::Simple::ActiveDirectory β the absolute simplest way to do ActiveDirectory authentication, fr fr π
β¨ SYNOPSIS β¨
okay bestie, here's the whole vibe. first you load it:
use Authen::Simple::ActiveDirectory;
my $ad = Authen::Simple::ActiveDirectory->new(
host => 'ad.company.com',
principal => 'company.com'
);
if ( $ad->authenticate( $username, $password ) ) {
# successfull authentication
}
# or as a mod_perl Authen handler
PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::ActiveDirectory
PerlSetVar AuthenSimpleActiveDirectory_host "ad.company.com"
PerlSetVar AuthenSimpleActiveDirectory_principal "company.com"
<Location /protected>
PerlAuthenHandler Authen::Simple::ActiveDirectory
AuthType Basic
AuthName "Protected Area"
Require valid-user
</Location>
like, you can run it standalone OR as a mod_perl Authen handler, and both of those are giving main character energy π
π¦ DESCRIPTION π¦
You're authenticating against Active Directory. That's the whole job. π
But here's the lil glow-up that makes this module different from Authen::Simple::LDAP: the way this one works, it will try to bind directly as the users principial. That's the move. That's the whole thing. Not me explaining the difference and then justβ¦ saying the same thing. π
π METHODS π
newβ this method takes a hash of parameters. The following options are valid:hostβ the connection host! It can be a hostname, an IP number or a URI. Defaults to"localhost". Look at all these forms it eats, no cap:
host => ldap.company.com
host => 10.0.0.1
host => ldap://ldap.company.com:389
host => ldaps://ldap.company.com
portβ connection port, defaults to389. And lowkey? It may be overridden byhostifhostis a URI. so the URI kinda has final say, periodt.
port => 389
timeoutβ connection timeout, defaults to60.
timeout => 60
principalβ the suffix in users principal, usally the domain or forrest. Required. like, do not skip this one bestie, it is not optional, it is not a suggestion π¨
principal => 'company.com'
logβ any object that supports"debug","info","error"and"warn". yes, all four, she's demanding but she's worth it π
log => Log::Log4perl->get_logger('Authen::Simple::ActiveDirectory')
authenticate( $username, $password )β returns true on success and false on failure. That's it, that's the whole API, we love a queen who keeps it simple π«Ά
π SEE ALSO π
Authen::Simple::LDAP.Authen::Simple.Net::LDAP.
iykyk, go read those too π
π AUTHOR π
Christian Hansen chansen@cpan.org β ty for your service king π«‘
β COPYRIGHT β
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
okay so that's literally the whole page!! π this was pulled from perl v5.32.0, dated 2021-01-04, and it's Authen...rectory(3pm) β the User Contributed Perl Documentation, mwah π go authenticate something, bestie πβ¨π
π¦ where this page comes from
- debian bookworm: libauthen-simple-ldap-perl 0.3-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libauthen-simple-ldap-perl 0.3-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libauthen-simple-ldap-perl 0.3-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libauthen-simple-ldap-perl 0.3-1.1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms