Net::D...::Async(3pm)
π NAME π
Net::Duo::Auth::Async β it's giving "representation of an asynchronous Duo authentication" β¨ literally that's the whole vibe, bestie.
πΈ SYNOPSIS πΈ
okay so this is the whole deal in like five lines:
use 5.010;
my $config = get_config();
my $duo = Net::Duo::Auth->new($config);
my $async = $duo->auth_async({ username => 'user', factor => 'auto' });
say scalar($async->status);
look at her. so small. so powerful. π«Ά
π REQUIREMENTS π
you need Perl 5.14 or later (yes queen, 5.14+, no cap) and these modules, all of which you can grab from CPAN:
HTTP::RequestandHTTP::Response(they come bundled inHTTP::Message)JSONLWPβ also known aslibwww-perl, iykykPerl6::SlurpSub::InstallURI::Escape(part ofURI)
not me listing six whole modules π but like, they're all on CPAN so you're fine bestie.
β¨ DESCRIPTION β¨
Net::Duo::Auth::Async represents an open asynchronous authentication attempt with Duo. she's a wrapper around the Duo async transaction ID and the method you use to check on the status of that transaction. main character energy fr.
so like, you can get this object in two ways:
- directly from a stored transaction ID β recreate her whenever you want
- as a return value from the
auth_async()method ofNet::Duo::Authβ she just shows up, unannounced, iconic
π CLASS METHODS π
π¦ new(DUO, ID)
make a brand new Net::Duo::Auth::Async object out of a Net::Duo object and a transaction.
use this to recreate the Net::Duo::Auth::Async object if the transaction ID got handed off to some other process that then asks for status later. yes that's a real scenario. yes it's a little chaotic. slay.
π INSTANCE METHODS π
π id()
returns the transaction ID that this object is representing. you can stash that transaction ID and use it later to recreate the object. periodt. πΎ
π status()
returns the status of the authentication. this one's got range depending on context, so pay attention:
in scalar context, she returns only the status β which will be one of:
"allow""deny""waiting"
"waiting" means the authentication is still in progress and hasn't completed yet. like she's still getting ready. give her a minute. β³
in list context, she returns the same status as the first element, plus a reference to a hash of additional info as the second element. that hash will have one or more of these keys:
statusβ a string detailing the progress or outcome of the authentication attempt. check the Duo Auth API documentation for the complete list of possible values, because there's a whole spectrum bestie.status_msgβ a string describing the result of the authentication attempt. if it got denied, it may identify a reason. this string is intended for display to the user, so like, feel free to show it.trusted_device_tokenβ if the trusted devices option is enabled for this account, this returns a token for a trusted device that you can later pass to the Duo"preauth"endpoint. π
π«Ά AUTHOR π«Ά
Russ Allbery <rra@cpan.org> β actual legend, thank you for your service π
π COPYRIGHT AND LICENSE π
Copyright 2014 The Board of Trustees of the Leland Stanford Junior University
okay so here's the legal bit, and we're keeping it exactly as written because that's how licenses work, no edits, no vibes-based paraphrasing:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
translation: free to use, just keep the notice, and no lawsuits if it breaks. the caps are doing the shouting so we don't have to. π£
π§ SEE ALSO π§
- Duo Auth API
<https://www.duo.com/docs/authapi>β go read the source of truth bestie - This module is part of the Net::Duo distribution. the current version of Net::Duo is available from CPAN, or directly from its web site at
<https://www.eyrie.org/~eagle/software/net-duo/>π¦
and that's the whole page!! this one's from perl v5.36.0, dated 2022-12-18, and it lives in the User Contributed Perl Documentation section of your friendly neighborhood man pages. go forth and async, bestie πβ¨π
π¦ where this page comes from
- debian bookworm: libnet-duo-perl 1.02-3 Β· MIT
- debian trixie: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu noble: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu resolute: libnet-duo-perl 1.02-3 Β· MIT
- ubuntu stonking: libnet-duo-perl 1.02-3 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms