Authen...le::SMB(3pm)

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

πŸ’– Authen::Simple::SMB (3pm) πŸ’–

okay bestie, welcome to the User Contributed Perl Documentation page for Authen::Simple::SMB β€” yes that's the module name, and no I'm not shortening it, it's literally called that. sit down, grab a strawberry πŸ“, we're doing SMB authentication and it's gonna be so chill.


✨ NAME ✨

Authen::Simple::SMB β€” Simple SMB authentication. that's it, that's the whole name section, it does what it says on the tin πŸ’…


🌸 SYNOPSIS 🌸

here's the vibe, in code:

use Authen::Simple::SMB;

my $smb = Authen::Simple::SMB->new(
    domain => 'DOMAIN',
    pdc    => 'PDC'
);

if ( $smb->authenticate( $username, $password ) ) {
    # successfull authentication
}

# or as a mod_perl Authen handler

PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::SMB

PerlSetVar AuthenSimpleSMB_domain "DOMAIN"
PerlSetVar AuthenSimpleSMB_pdc    "PDC"

<Location /protected>
  PerlAuthenHandler Authen::Simple::SMB
  AuthType          Basic
  AuthName          "Protected Area"
  Require           valid-user
</Location>

so you can use it plain, or you can go full mod_perl Authen handler mode and guard a <Location> block like the main character you are πŸ‘‘ the config vars are literally named after the options with AuthenSimpleSMB_ glued on the front, iykyk.

ngl that # successfull authentication comment has two L's and I am NOT fixing it, because the rule is we keep everything exactly as it is. copy-paste energy only 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

you authenticate against an SMB server. that's the whole thing. no cap. it's giving "log into the Windows-y file sharing world from your lil Perl script" and honestly? iconic.


🌈 METHODS 🌈

πŸŽ€ new

this method takes a hash of parameters. the following options are valid, and bestie, there's a Required situation so pay attention:

  • domain β€” the domain to authenticate against. Required. like, you literally cannot skip this one.
domain => 'NTDOMAIN'
  • pdc β€” the Primary Domain Controller. Required. also mandatory, no skipping, no "I'll add it later" 🫠
pdc => 'PDC'
  • bdc β€” the Backup Domain Controller. this one's optional, it's the understudy, the backup dancer πŸ’ƒ
bdc => 'BDC'
  • log β€” any object that supports debug, info, error and warn. so like, any logger that speaks that exact dialect of method names.
log => Log::Log4perl->get_logger('Authen::Simple::SMB')

πŸ”₯ authenticate( $username, $password )

returns true on success and false on failure. that's the whole contract. slay. simple as.


πŸ’œ SEE ALSO πŸ’œ

go read these too, they're the friends of this module:

  • Authen::Simple.
  • Authen::Smb.

⭐ AUTHOR ⭐

Christian Hansen ch@ngmedia.com β€” shoutout, legend, the person who wrote this πŸ’–


This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the page bestie!! this whole thing was Authen::Simple::SMB(3pm), generated as part of the User Contributed Perl Documentation, from perl v5.34.0, dated 2022-06-08. go authenticate something, ily, bye πŸ¦‹βœ¨πŸŽ€