Firefo...dential(3pm)

πŸ“¦ version 1.63, in debian trixie

πŸ’– Firefox::Marionette::WebAuthn::Credential β€” the WebAuthn credential baddie πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation (that's the 3pm manual, iykyk) and it's all about one single WebAuthn credential. One. Singular. She's not like other modules. πŸŽ€


✨ NAME ✨

Firefox::Marionette::WebAuthn::Credential β€” literally just represents a Firefox WebAuthn Credential. that's the whole job. she's a credential and she's doing great. πŸ’…


🌸 VERSION 🌸

Version 1.63. noted. iconic. moving on. ✨


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole vibe in code form, no notes:

use Firefox::Marionette();
use Crypt::URandom();

my $user_name = MIME::Base64::encode_base64( Crypt::URandom::urandom( 10 ), q[] ) . q[@example.com];
my $firefox = Firefox::Marionette->new();
$firefox->go('https://webauthn.io');
$firefox->find_id('input-email')->type($user_name);
$firefox->find_id('register-button')->click();
$firefox->await(sub { sleep 1; $firefox->find_class('alert-success'); });
$firefox->find_id('login-button')->click();
$firefox->await(sub { sleep 1; $firefox->find_class('hero confetti'); });
foreach my $credential ($firefox->webauthn_credentials()) {
    $firefox->delete_webauthn_credential($credential);

# ... time passes ...

    $firefox->add_webauthn_credential(
              id            => $credential->id(),
              host          => $credential->host(),
              user          => $credential->user(),
              private_key   => $credential->private_key(),
              is_resident   => $credential->is_resident(),
              sign_count    => $credential->sign_count(),
                          );
}
$firefox->go('about:blank');
$firefox->clear_cache(Firefox::Marionette::Cache::CLEAR_COOKIES());
$firefox->go('https://webauthn.io');
$firefox->find_id('input-email')->type($user_name);
$firefox->find_id('login-button')->click();
$firefox->await(sub { sleep 1; $firefox->find_class('hero confetti'); });

like… grab the creds, yeet them, wait for time to pass (the comment said it, not me 🫢), then add them all back in and log in again. main character behaviour fr fr.


πŸ’œ DESCRIPTION πŸ’œ

this module handles the implementation of a single WebAuth Credential, and it does it over the Marionette protocol. one credential. one module. obsessed. ✨


πŸ‘‘ SUBROUTINES/METHODS πŸ‘‘

🌈 new

she takes a hash as a parameter, bestie. the allowed keys are right here:

this method hands you back a brand new Firefox::Marionette::WebAuthn::Credential object. slay. ✨

🧚 host

returns the domain this credential is meant to be used for. and yeah, in WebAuthn language (https://www.w3.org/TR/webauthn-2) this is the relying party identifier (https://www.w3.org/TR/webauthn-2/#relying-party-identifier), a.k.a. the RP ID (https://www.w3.org/TR/webauthn-2/#rp-id). same thing, fancy name, we love a rebrand. πŸ’…

πŸ“ is_resident

returns a boolean. true means a client-side discoverable credential (https://w3c.github.io/webauthn/#client-side-discoverable-credential) is what's getting created. false means it's a server-side credential (https://w3c.github.io/webauthn/#server-side-credential) instead. the duality of credential. πŸ¦‹

πŸ”₯ private_key

returns an RFC5958 (https://www.rfc-editor.org/rfc/rfc5958) encoded private key, encoded using encode_base64url. that's it, that's the tweet. πŸ’…

⭐ sign_count

returns the signature counter (https://w3c.github.io/webauthn/#signature-counter) associated with the public key credential source (https://w3c.github.io/webauthn/#public-key-credential-source). numbers go up. πŸ”₯

πŸ’– user

returns the userHandle (https://w3c.github.io/webauthn/#public-key-credential-source-userhandle) associated with the credential, encoded using encode_base64url. 🫢


πŸ’€ DIAGNOSTICS πŸ’€

None. nothing. silence. the calmest section on this whole page. 😭


🌸 CONFIGURATION AND ENVIRONMENT 🌸

Firefox::Marionette::WebAuthn::Credential requires no configuration files and no environment variables. zero setup, zero drama, we love a low-maintenance queen. ✨


🌈 DEPENDENCIES 🌈

None. she's independent. πŸ’…


πŸ™ˆ INCOMPATIBILITIES πŸ™ˆ

None reported. no beef. we're at peace. πŸŽ€


πŸ’œ BUGS AND LIMITATIONS πŸ’œ

wanna report a bug, or go stare at the current list of bugs? bestie, please visit https://github.com/david-dick/firefox-marionette/issues. they want to hear from you. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

David Dick "ddick@cpan.org" β€” the author, the moment, the legend. πŸ’–


Copyright (c) 2024, David Dick "ddick@cpan.org". All rights reserved.

this module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. see "perlartistic" in perlartistic.


⚠️ DISCLAIMER OF WARRANTY ⚠️

okay bestie this part is in ALL CAPS because it is serious and legally it has to stay exactly like this. read it, don't skip it, it's important:

BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

and that's the whole page, bestie!! πŸ¦‹ this one came to you from perl v5.40.1, dated 2025-03-16, and honestly? she ate. go build something with WebAuthn credentials. periodt. πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from