cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2284
Views
0
Helpful
6
Replies

DUO API : 401, ReasonPhrase: 'Unauthorized' using HTTPClient in POST

kpn1
Level 1
Level 1

DUO Community-

When trying to access the DUO API to get the DUO User Info using HTTPClient in POST.
https://****.com/admin/v1/users , getting Error : 401, ReasonPhrase: ‘Unauthorized’

But its working fine when using GET by passing userid in query string
https://*******.com/admin/v1/users?username=testuser

Please advise

Thanks
Samy

6 Replies 6

DuoKristina
Cisco Employee
Cisco Employee

Hey there Samy,

You POST to make a change, or GET to retrieve information. You wouldn’t POST to retrieve information (implied by the statement “to get the DUO User Info using HTTPClient in POST”).

Compare these GET operations: Retrieve Users, Retrieve Groups to these POST operations: Create User. Create Group.

So, a GET on /admin/v1/users would return the full list of Duo users, but a POST on /admin/v1/users won’t do anything.

Just wanted to clarify what action you are trying to perform in the POST.

Duo, not DUO.

Thanks so much for the reply.

Yes, I used POST to retrieve the Info. I will check these methods and get back to you.

Thanks

Samy

Hi-

GET is working fine, able to Retrieve the User.

But POST / DELETE ,not working, getting ‘UnAuthorized’ Error. This issue is there in HTTPClient. But the same data working fine in WebClient.

please let me know if you need any other details

Thanks

Samy

I’m not sure why you are receiving an error and frankly I don’t understand what you are trying to do via POST. Can you provide an example?

Duo, not DUO.

Thanks-

Never mind. I found the issue and fixed it.

Auth Key data was not correct.

Thanks again for your support.

-Samy

Not sure if this would be applicable to your scenario, but you can use workato to connect to Duo via API to search for events and change Duo-user state.
Workato has SDK connector for Duo API:
https://www.workato.com/custom_adapters/4384?token=38cfde2f

Quick Links