Cataly...Simple(3pm)

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

πŸ’– Cataly...Simple(3pm) πŸ’–

okay bestie, this is Catalyst::Authentication::Credential::Authen::Simple β€” the Perl manpage, the whole thing, but make it cute. it's from the User Contributed Perl Documentation section (section 3pm, we love a 3pm moment) and it's here to Verify credentials with the Authen::Simple framework. no cap. 🫢


🌸 NAME 🌸

Catalyst::Authentication::Credential::Authen::Simple β€” verify credentials with the Authen::Simple framework. it's giving "one credential class to rule them all" and honestly? iconic. πŸ‘‘


✨ SYNOPSIS ✨

  use Catalyst qw(Authentication);
  # later on ...
  if ($c->authenticate({ username => 'myusername',
                         password => 'mypassword' })){
    my $long_name = $c->user->get('LongName');
    # Hello Mr $long_name
  }

see how chill that is?? you authenticate, you get your user, you say hi to Mr $long_name. the whole vibe check passes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

this module helps your Catalyst Application authenticate against a lot of credential databases, and it does it thanks to the Authen::Simple framework. like, a lot a lot. so many credential databases. you're welcome. πŸŽ€


🌈 USAGE 🌈

bestie listen, the setup is literally just this: configure your Catalyst App Authentication to use the class 'Authen::Simple' as the credential verifier, and hand it a set of Authen::Simple classes. that's the whole assignment.

you can pass arguments to the Authen::Simple:XXX class constructors with the 'args' key. note that the authen key is an array β€” yes, an array, not a single thing, don't @ me. πŸ“

and here's the tea: if more than one class is specified, when your app authenticates, the username and password get submitted to each class until one of the classes returns that the user/pass pair is valid. it's a little relay race of authentication. πŸƒβ€β™€οΈ and if no class validates the credentials? the user is not able to log in. periodt. that's it. no login for them. πŸ’€

  'Plugin::Authentication' => {
    'realms' => {
      'default' => {
        'store' => { ... }
        'credential' => {
          'class' => 'Authen::Simple',
          'authen' => [
            {
              'class' => 'Passwd',
              'args' => {
                'path' => '/etc/shadow'
              }
            },
            {
              'class' => 'SSH',
              'args' => {
                'host' => 'host.company.com'
              }
            }
          ]
        }
      }
    }
  }

look at that config. structured. organized. main character energy. 🌟

oh and also β€” if the Catalyst log object is compatible with the Authen::Simple log object, the Authen::Simple classes will log through Catalyst. the logs stay in the family. 🫢

πŸ’œ new πŸ’œ

Called by Catalyst::Authentication. It instances the Authen::Simple classes read from the configuration. constructor behavior, we love to see it. ✨

πŸ’œ authenticate πŸ’œ

Usage     : Call $c->authenticate({ username => ..., password => ...});
Returns   : User object if the credentials are verified successfully. undef if user not authenticated.

so: call it, and you either get a User object (slay) or you get undef (not slay). that's the binary. that's the whole story. πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

    Jose Luis Martinez
    CPAN ID: JLMARTIN
    CAPSiDE
    jlmartinez@capside.com
    http://www.pplusdomain.net

the legend themselves. respect the author, always. πŸŽ€


🌸 THANKS 🌸

Tobjorn Lindahl, Dylan Martin, Tomas Doran and Inigo Tejedor Arrondo for patches and recommedations. y'all are the real ones, fr fr. πŸ’–


Copyright (c) 2008 by Jose Luis Martinez Torres

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

The full text of the license can be found in the LICENSE file included with this module.

so yeah β€” free software, same terms as Perl, and if you want the full legal novel it's chilling in the LICENSE file that ships with this module. πŸ“œβœ¨


πŸ¦‹ SEE ALSO πŸ¦‹

  • Authen::Simple and all of the Authen::Simple::XXX classes β€” go read them, they're the whole supporting cast. πŸ’…

and that's the page, bestie!! this one came from perl v5.34.0, dated 2022-06-09, and it lives at Cataly...Simple(3pm). mwah, go authenticate something. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from