Firefo...dential(3pm)
π 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:
hostβ the domain this credential is meant for. in WebAuthn speak (https://www.w3.org/TR/webauthn-2) this field is called the relying party identifier (https://www.w3.org/TR/webauthn-2/#relying-party-identifier) or the RP ID (https://www.w3.org/TR/webauthn-2/#rp-id).idβ the unique id for this credential, aka the Credential ID (https://www.w3.org/TR/webauthn-2/#credential-id).is_residentβ a boolean. set it to true and a client-side discoverable credential (https://w3c.github.io/webauthn/#client-side-discoverable-credential) gets created. set it to false and you get a server-side credential (https://w3c.github.io/webauthn/#server-side-credential) instead. pick your fighter πprivate_keyβ either an RFC5958 (https://www.rfc-editor.org/rfc/rfc5958) encoded private key that's been encoded usingencode_base64url, or a hash with these keys in it:nameβ the name of the private key algorithm, like"RSA-PSS"(this one's the default),"RSASSA-PKCS1-v1_5","ECDSA"or"ECDH".sizeβ the modulus length of the private key. this one only does anything for"RSA-PSS"or"RSASSA-PKCS1-v1_5"private keys.hashβ the name of the hash algorithm, like"SHA-512"(the default). also only valid for"RSA-PSS"or"RSASSA-PKCS1-v1_5"private keys.curveβ the name of the curve for the private key, like"P-384"(the default). this one's only valid for"ECDSA"or"ECDH"private keys.
sign_countβ the initial value for a signature counter (https://w3c.github.io/webauthn/#signature-counter) tied to the public key credential source (https://w3c.github.io/webauthn/#public-key-credential-source).userβ the userHandle (https://w3c.github.io/webauthn/#public-key-credential-source-userhandle) associated with the credential, encoded usingencode_base64url. this property is optional, so you can justβ¦ not. π
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. π
π LICENSE AND COPYRIGHT π
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
- debian trixie: libfirefox-marionette-perl 1.63-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms