Auth_status endpoint waiting for request completion?


#1

Hi There,

I’m attempting to build an authentication integration through the API. Most everything is working as expected, except for the auth_status endpoint when working through an ‘asynchronous’ request (only tested using the ‘push’ factor)

The initial request returns the ‘txid’ attribute as documented.

However, when I then try to check on the status of that authentication after a few seconds using the auth_status endpoint, sending ‘txid’ as a parameter, the API call results are not returned until the authentication request has completed (‘allow’ or ‘deny’), or the https connection times out, similar to a ‘non’-asynchronous request.

This isn’t what I had anticipated, thinking instead the results of the query would be returned ‘immediately’, indicating whether the request has completed, or is still ‘waiting’. Have I made an incorrect assumption, or perhaps done something wrong?

Thanks,
Sean.


#2

Could you provide an example of your application’s POST to /auth/v2/auth?


#3

Sure thing!

I’m pulling these values out of the example Java client with some added ‘println’ lines…

To /auth/v2/auth endpoint is posted:
async=1&device=$deviceId&factor=push&username=$uid
where $deviceId is the Duo ID for the device
and where $uid is the Duo username associated with ‘my’ (test) account.

The endpoint returns (in my latested test):
{“txid”: “$transactionId”}

where $transactionId is a GUID that I assume is a ‘transaction identifier’ :slight_smile:

I then send a ‘GET’ request to:
/auth/v2/auth_status

with the query parameters:
txid=$transactionId

… and the call to that endpoint holds the HTTPs connection open until the authentication is complete, or the HTTPs connection times out.

Thanks,
Sean.