Auth::...bClient(3pm)

πŸ“¦
version 4.02 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 bug http://rt.cpan.org/Public/Bug/Display.html?id=51121
  • 1.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 \r bug (Thanks to Peter Norin)
  • 3.00 - Major update
  • 4.01 - 13.10.2016 - Requested by Peter Norin - update to use LWP::UserAgent, and the option to overwrite a valid SSL certificate (verify_hostname). The API default server is changed to ssl.
  • 4.02 - 2019.04.04 - Request by Alexandre Linte - Support for proxy servers

πŸŽ€ ACKNOWLEDGEMENTS πŸŽ€

(nothing listed here, bestie β€” the section is just vibes. πŸ’–)


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 of perl v5.36.0, dated 2022-11-19, under Auth::...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