Authen...::SCRAM(3pm)

✨ Authen::SASL::SCRAM ✨

okay bestie, so this is a page from the Perl User Contributed Perl Documentation and it's literally about Authen::SASL::SCRAM, the module that gives you SCRAM support for Authen::SASL. yes we're doing auth stuff today. yes it's gonna be fun. sit down, grab a boba πŸ§‹, and let's go.


🌸 NAME 🌸

Authen::SASL::SCRAM β€” SCRAM support for Authen::SASL πŸ’…


πŸŽ€ VERSION πŸŽ€

This is version 0.04, bestie. tiny number, big energy. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole vibe, copied exactly so you can just paste it and go:

# with Authen::SASL::SCRAM installed
use Authen::SASL;

my $client = Authen::SASL->new(
     username => 'user',
     password => 'pass',
     mechanism => 'SCRAM-SHA-512 SCRAM-SHA-256 SCRAM-SHA-1 PLAIN'
);
# authenticates using SCRAM SHA hash or PLAIN

my $salt = 'your-precious-salt';
# $server_key and $stored_key need to be looked up from a user store
my $server_key = 'server-key-stored-for-this-user';
my $stored_key = 'key-stored-for-this-user';
my $server => Authen::SASL->new(
    mechanism => 'SCRAM-SHA-1', # selected mechanism
    callback => {
         getsecret => sub {
              my $username = shift;
              return ($salt, $stored_key, $server_key, $iterations);
         },
    }
);

so like, first block: you're the client πŸ’β€β™€οΈ, you hand over username, password and a mechanism list, and it authenticates using SCRAM SHA hash or PLAIN. second block: you're the server</c> side-ish setup, you got your $salt (she's precious, protect her), and your $server_key and $stored_key β€” those two need to be looked up from a user store, no cap. then the getsecret callback returns ($salt, $stored_key, $server_key, $iterations). that's it. that's the whole recipe. 🫢


πŸ”₯ DESCRIPTION πŸ”₯

The Authen::SASL::SCRAM distribution adds Authen::SASL support for SCRAM authentication using the mechanisms listed below, by wrapping Authen::SCRAM. it's giving ✨delegation✨, it's giving 🧚middleware🧚, it's giving "I don't do the crypto, my friend does".

the mechanisms, bestie, in order:

  • SHA-1 (SCRAM-SHA-1)
  • SHA-256 (SCRAM-SHA-256)
  • SHA-512 (SCRAM-SHA-512)
okay important thing, don't skip this: the *-PLUS variants are NOT supported at this time. so if you were hoping for the PLUS ones... not today, bestie. 😭 not today.

πŸ’€ BUGS πŸ’€

found a bug? (rude of it, honestly.) please report bugs via https://github.com/ehuelsmann/authen-sasl-scram/issues. the maintainers will appreciate you fr fr. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, they're iconic:

  • Authen::SASL
  • Authen::SCRAM

🌈 AUTHOR 🌈

Erik Huelsmann <ehuels@gmail.com> β€” the main character who wrote this. πŸ‘‘


Copyright (c) 2023 Erik Huelsmann. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

like, same terms as Perl itself, so go forth and remix responsibly. ✨


aaaand that's the whole page bestie!! πŸŽ‰ this doc was served up by perl v5.36.0 on 2023-08-09, and honestly? iconic date, iconic module, iconic read. now go authenticate something and slay πŸ’…πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from