05-23-2018 09:57 AM
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
05-25-2018 09:50 AM
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.
05-25-2018 10:04 AM
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
05-29-2018 03:31 PM
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
05-30-2018 05:20 AM
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?
05-30-2018 10:22 AM
Thanks-
Never mind. I found the issue and fixed it.
Auth Key data was not correct.
Thanks again for your support.
-Samy
11-05-2018 06:50 PM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide