Net::Duo::Auth::Async(3pm)

Net::Duo::Auth::Async3pm

Representation of an asynchronous duo authentication

Usage

    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);

Requirements

Perl 5.14 or later and the modules HTTP::Request and HTTP::Response (part of HTTP::Message), JSON, LWP (also known as libwww-perl), Perl6::Slurp, Sub::Install, and URI::Escape (part of URI), all of which are available from CPAN.

Overview

Net::Duo::Auth::Async represents an open asynchronous authentication attempt with Duo. It's a wrapper around the Duo async transaction ID and the method to check on the status of that transaction. This object can either be created directly from a stored transaction ID or is returned by the auth_async() method of Net::Duo::Auth.

Class methods

new(DUO, ID)

Create a new Net::Duo::Auth::Async object from a Net::Duo object and a transaction. This should be used to recreate the Net::Duo::Auth::Async object if the transaction ID were handed off to some other process that then asks for status later.

Instance methods

id()

Returns the transaction ID represented by this object. This transaction ID can be used later to recreate the object.

status()

Returns the status of the authentication.

In scalar context, returns only the status, which will be one of "allow", "deny", and "waiting". "waiting" indicates that the authentication is still in progress and has not yet completed.

In list context, returns the same status as the first element and a reference to a hash of additional information as the second element. The hash will have one or more of the following keys:

status

String detailing the progress or outcome of the authentication attempt. See the Duo Auth API documentation for a complete list of possible values.

status_msg

A string describing the result of the authentication attempt. If the authentication attempt was denied, it may identify a reason. This string is intended for display to the user.

trusted_device_token

If the trusted devices option is enabled for this account, returns a token for a trusted device that can later be passed to the Duo "preauth" endpoint.

Releases

6 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12–13

Author

Russ Allbery <[email protected]>

From libnet-duo-perl 1.02-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.