Authen...::HTTP(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::HTTP ✨

okay bestie, gather round πŸ’– this is Authen::Simple::HTTP, a lil Perl module from the User Contributed Perl Documentation collection, and it's literally just "Simple HTTP authentication" β€” that's the whole vibe. it's giving tiny, it's giving useful, it's giving let me check your password against some HTTP server real quick. no cap. 🫢


🌸 SYNOPSIS 🌸

so like, here's how you actually use it:

use Authen::Simple::HTTP;

my $http = Authen::Simple::HTTP->new(
    url => 'http://www.host.com/protected'
);

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

# or as a mod_perl Authen handler

PerlModule Authen::Simple::Apache
PerlModule Authen::Simple::HTTP

PerlSetVar AuthenSimpleHTTP_url "http://www.host.com/protected"

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

and yes that # successfull authentication comment is staying exactly like that, typos are canon here πŸ’… (not me preserving the spelling, but fr fr we do not touch the code blocks. ever.)


πŸ¦‹ DESCRIPTION πŸ¦‹

Authenticate against an HTTP server. that's it. that's the whole thing. you point it at a server, it checks if the username + password combo slaps or not. iconic behaviour honestly ✨


πŸŽ€ METHODS πŸŽ€

πŸ’… new

This method takes a hash of parameters. The following options are valid:

  • url β€” Url to authenticate against. Required. like, you literally cannot skip this one bestie, it's the whole point. 🚨
url => 'http://www.host.com/protected'
  • agent β€” Any object that is a subclass of LWP::UserAgent.
agent => LWP::UserAgent->new;
  • log β€” Any object that supports debug, info, error and warn.
log => Log::Log4perl->get_logger('Authen::Simple::HTTP')

πŸ‘‘ authenticate( $username, $password )

Returns true on success and false on failure. that's it. boolean queen. βœ…βŒ


🌈 SEE ALSO 🌈

  • Authen::Simple.
  • LWP::UserAgent.
  • LWPx::ParanoidAgent.

go read those too, iykyk πŸ“šβœ¨


πŸ’– AUTHOR πŸ’–

Christian Hansen ch@ngmedia.com β€” 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. free as in freedom, slay 🌸


and that's the whole page bestie!! this doc came from perl v5.34.0, dated 2022-06-08, so if you're reading this in the future just know it was giving 2022 energy πŸ’€βœ¨ mwah, go authenticate something responsibly πŸŽ€πŸ’œ

πŸ“¦ where this page comes from