Auth::...bClient(3pm)
π Auth::Yubikey_WebClient β the vibe check for your Yubikey π
okay bestie, so this is a User Contributed Perl Documentation page for Auth::Yubikey_WebClient, sitting pretty in section 3pm of the manual. Translation: it's the Perl module that takes your Yubikey's one-time password and asks the Yubico Web API "hey is this real" so you don't have to. no cap. π₯
β¨ NAME β¨
Auth::Yubikey_WebClient β authenticating the Yubikey against the Yubico Web API. that's it, that's the whole job description π
πΈ VERSION πΈ
Version 4.02. she's grown up. π
π¦ SYNOPSIS π¦
the goal: authenticate against the Yubico server via the Web API in Perl. periodt.
sample CGI script, literally copy-paste this energy:
#!/usr/bin/perl
use CGI;
use strict;
my $cgi = new CGI;
my $otp = $cgi->param("otp");
print $cgi->header();
print "<html>\n";
print "<form method=get>Yubikey : <input type=text name=otp size=40 type=password></form>\n";
use Auth::Yubikey_WebClient;
my $id = "<enter your id here>";
my $api = "<enter your API key here>";
my $nonce = "<enter your nonce here>";
if($otp)
{
my $result = Auth::Yubikey_WebClient::yubikey_webclient($otp,$id,$api,$nonce);
# result can be either ERR or OK
print "Authentication result : <b>$result</b><br>";
}
print "</html>\n";
π FUNCTIONS π
π new
creates a new Yubikey Webclient connection, like introducing yourself to the server. so polite.
use Auth::Yubikey_WebClient;
my $yubi = Auth::Yubikey_WebClient->new({
id => <enter your id here> ,
api => '<enter your API key here>' ,
nonce => '<enter your nonce if you have one>',
verify_hostname => 0 # optional - defaults to 1. Can be set to 0 if you do not want to check the validity of the SSL certificate when querying the Yubikey server
});
and you can overwrite the URL being called if you wanna hit an alternate authentication server instead, main character energy:
use Auth::Yubikey_WebClient;
my $yubi = Auth::Yubikey_WebClient->new({
id => <enter your id here> ,
api => '<enter your API key here>' ,
nonce => '<enter your nonce if you have one>',
url => 'http://www.otherserver.com/webapi.php'
});
π debug
displays the debug info. she's nosy and we love her for it.
$yubi->debug();
it prints out some debug information. super useful to call after authentication so you can see what Yubico sent back. π«Ά and lowkey you can also call the variables yourself β for example, if you'd like to see what the token ID is, call $yubi->{publicid}. same goes for all the other variables printed in debug.
π yubikey_webclient
π otp
check a OTP for validity β¨
$result = $yubi->otp($otp);
call the otp procedure with the input from the yubikey. it will return the result.
this function will also setup a few internal variables that was returned from Yubico. (yes, exactly like that. we keep it real here.)
π§ USAGE π§
before you can use this module, you need to register for an API key at Yubico. it's as simple as logging onto https://upgrade.yubico.com/getapikey/ and entering your Yubikey's OTP and your email address. once you have the API and ID, you need to provide those details to the module so it actually works. no key, no slay. π
π AUTHOR π
Phil Massyn, "<massyn at gmail.com>" β iconic.
π BUGS π
please report any bugs or feature requests to "bug-auth-yubikey_webclient at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Auth-Yubikey_WebClient. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. we love a feedback loop π
β SUPPORT β
you can find documentation for this module with the perldoc command.
perldoc Auth::Yubikey_WebClient
you can also look for information at:
- RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Auth-Yubikey_WebClient
- AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Auth-Yubikey_WebClient
- CPAN Ratings
http://cpanratings.perl.org/d/Auth-Yubikey_WebClient
- Search CPAN
http://search.cpan.org/dist/Auth-Yubikey_WebClient
π Version history π
okay so here's the glow-up timeline, in order, don't skip any of it:
0.04- Fixed bughttp://rt.cpan.org/Public/Bug/Display.html?id=511211.00- Added validation of the request to Yubico (Thanks to Kirill Miazine)2.00- Added nounce coding (Thanks to Ludvig af Klinteberg)2.01- Response turning into an array due to\rbug (Thanks to Peter Norin)3.00- Major update4.01- 13.10.2016 - Requested by Peter Norin - update to useLWP::UserAgent, and the option to overwrite a valid SSL certificate (verify_hostname). The API default server is changed tossl.4.02- 2019.04.04 - Request by Alexandre Linte - Support for proxy servers
π ACKNOWLEDGEMENTS π
(nothing listed here, bestie β the section is just vibes. π)
π COPYRIGHT & LICENSE π
Copyright 2016 Phil Massyn, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π heads up: this whole page comes to you courtesy ofperl v5.36.0, dated2022-11-19, underAuth::...bClient(3pm)in the manual β so if you're out here shipping Yubikey auth, that's the version-and-date tea. drink responsibly. π¦β¨
π¦ where this page comes from
- debian bookworm: libauth-yubikey-webclient-perl 4.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libauth-yubikey-webclient-perl 4.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libauth-yubikey-webclient-perl 4.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libauth-yubikey-webclient-perl 4.02-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libauth-yubikey-webclient-perl 4.02-3 Β· 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