URI::otpauth(3)

πŸ’– URI::otpauth πŸ’–

okay so bestie, real talk: this is the manual for URI::otpauth, a Perl module from the URI family. It's the URI scheme for secret keys for OTP secrets β€” and yeah, that's exactly the thing you usually find hiding in QR codes. πŸŽ€


✨ VERSION ✨

Version 5.29 β€” that's the one, no cap.


🌸 SYNOPSIS 🌸

use URI;

# optauth URI from textual uri
my $uri = URI->new( 'otpauth://totp/Example:alice@google.com?secret=NFZS25DINFZV643VOAZXELLTGNRXEM3UH4&issuer=Example' );

# same URI but created from arguments
my $uri = URI::otpauth->new( type => 'totp', issuer => 'Example', account_name => 'alice@google.com', secret => 'is-this_sup3r-s3cr3t?' );

(and yes, optauth in that first comment is literally how the original spells it β€” we keep the receipts πŸ’…)


πŸ¦‹ DESCRIPTION πŸ¦‹

This URI scheme is defined right here: https://github.com/google/google-authenticator/wiki/Key-Uri-Format/

That's the whole vibe check. Moving on, main character style. ✨


πŸ‘‘ SUBROUTINES/METHODS πŸ‘‘

🫢 "new"

Creates a brand-new URI::otpauth. The arguments you can slide in are listed below:

ngl bestie, that secret one? Treat it like your deepest darkest secret, because that's literally what it is. Keep it private, fr fr. πŸ™ˆ

πŸ’œ "algorithm"

Get or set the algorithm of this otpauth URI.

πŸ’œ "account_name"

Get or set the account_name of this otpauth URI.

πŸ’œ "counter"

Get or set the counter of this otpauth URI.

πŸ’œ "digits"

Get or set the digits of this otpauth URI.

πŸ’œ "issuer"

Get or set the issuer of this otpauth URI.

πŸ’œ "label"

Get or set the label of this otpauth URI.

πŸ’œ "period"

Get or set the period of this otpauth URI.

πŸ’œ "secret"

Get or set the secret of this otpauth URI.

πŸ’œ "type"

Get or set the type of this otpauth URI.

my $type = $uri->type('hotp');

(look at that β€” get and set in one iconic little line πŸŽ€)


🌈 CONFIGURATION AND ENVIRONMENT 🌈

URI::otpauth requires no configuration files or environment variables. Zero setup, we love a low-maintenance icon. ✨


🧚 DEPENDENCIES 🧚

  • URI

πŸ’€ DIAGNOSTICS πŸ’€

  • "secret is a mandatory parameter for URI::otpauth" β€” the secret parameter was not detected for the URI::otpauth->new() method. Yeah. It's mandatory. It said what it said. 😭

πŸ“ INCOMPATIBILITIES πŸ“

None reported. (a peaceful, drama-free era πŸ•ŠοΈ)


⭐ BUGS AND LIMITATIONS ⭐

To report a bug, or to view the current list of bugs, please visit https://github.com/libwww-perl/URI/issues β€” the devs are literally waiting for you there. 🫢


🌸 AUTHOR 🌸

David Dick <ddick@cpan.org>


Copyright (c) 2024, David Dick <ddick@cpan.org>.

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


and that's the whole page bestie β€” this was perl v5.42.0, dated 2026-09-02, and it's giving iconic documentation energy. slay, go rotate some secrets responsibly πŸ’…βœ¨

πŸ“¦ where this page comes from