Authen...rectory(3pm)

πŸ“¦
version 0.3 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

🌸 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 to 389. And lowkey? It may be overridden by host if host is a URI. so the URI kinda has final say, periodt.
port => 389
  • timeout β€” connection timeout, defaults to 60.
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 🫑


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