Linux curl to Admin API for admin/v1/users


#1

3 different methods/approaches, getting 3 different errors.

{“code”: 40101, “message”: “Missing request credentials”, “stat”: “FAIL”}

{“code”: 40104, “message”: “Missing request timestamp”, “stat”: “FAIL”}

{“code”: 40103, “message”: “Invalid signature in request credentials”, “stat”: “FAIL”}

Any idea which one is closer to getting through?

All I want is a simple user dump “admin/v1/users”. That’s it. That’s all I need. If you have a curl example that does this, I’d REALLY appreciate it.


#2

How are you constructing the HTTP basic authentication header for the curl request?


#3

2 different 1 line scripts calling curl:

First one has login credentials straight up with a colon (:slight_smile: separator

#!/bin/sh

curl --request GET -H “Date: Tue, 26 Feb 2019 08:59:26 -0500” -H “Content-Type: application/x-www-form-urlencoded” -H “Authorization: Basic DIB4BV*********:pe3z8**************” https://api-5*******.duosecurity.com/admin/v1/users

Results:
{“code”: 40101, “message”: “Missing request credentials”, “stat”: “FAIL”}

This script has the login creds base 64’d

#!/bin/sh

curl --request GET -H “Content-Type: application/x-www-form-urlencoded” -H “Authorization: Basic RElCNEJWTlhXBase64***==” -H “Date: Tue, 26 Feb 2019 08:59:26 -0500” “https://api-5*********.duosecurity.com/admin/v1/users”

Results:

{“code”: 40103, “message”: “Invalid signature in request credentials”, “stat”: “FAIL”}