Giter Club home page Giter Club logo

Comments (10)

AaronAtDuo avatar AaronAtDuo commented on June 19, 2024

@BugWizard That specific example (get_billing_and_telephony_credits.py) is for the Accounts API, which is separate (sort of) from the Admin API. A different integration type and set of credentials is used for the Accounts API, since that is usually only of use to MSP or customers that manage multiple Duo accounts. If you were just running examples to test with, you probably want to avoid that one if you don't need it; but if you specifically do need to access account information, you'll need to contact Duo Support for Accounts API access if you don't already have it.

See more info on the Accounts API at https://duo.com/docs/accountsapi

Let us know if you have any questions, and thanks for using Duo.

from duo_client_python.

BugWizard avatar BugWizard commented on June 19, 2024

from duo_client_python.

AaronAtDuo avatar AaronAtDuo commented on June 19, 2024

@BugWizard I'm not sure that either API can tell you how many credits an SMS auth will require? Based on my reading of the telephony-related API calls for both APIs:
https://duo.com/docs/adminapi#telephony-credits-used-report
https://duo.com/docs/accountsapi#get-telephony-credits
there's very little telephony information accessible.

In general, though, the Admin API is used for getting information about a single account, and the Accounts API is used for getting that same information about child accounts.

from duo_client_python.

DuoKristina avatar DuoKristina commented on June 19, 2024

@BugWizard The Admin API Telephony reporting endpoint can tell you how many credits were used for an individual SMS authentication event that already happened: https://duo.com/docs/adminapi#telephony-logs

If you want to know how many credits SMS to a given country will cost view our rate card here: https://duo.com/docs/telephony-credits#rate-card.

from duo_client_python.

BugWizard avatar BugWizard commented on June 19, 2024

I see!
How would one go about if they wanted to GET only the information of all the Users using the SMS as a way to login?(sms_passcode)?
I apologize for all these noob questions..

I have tried to make custom request for '/admin/v2/logs/authentication' and get the sms_passcode unsuccessfully.

from duo_client_python.

AaronAtDuo avatar AaronAtDuo commented on June 19, 2024

@BugWizard I think this method on the Admin class would do it:
get_authentication_log(api_version=2, factors=["sms_passcode"])
As described in https://duo.com/docs/adminapi#authentication-logs
In a real application, you'd probably want to use the mintime and maxtime to ensure you don't fetch the same authentication multiple times.

You might want to check out our log sync application (https://github.com/duosecurity/duo_log_sync) which is designed to extract Duo logs to an external log tool, if you have something like a SIEM available.

Hope this helps.

from duo_client_python.

BugWizard avatar BugWizard commented on June 19, 2024

Hi sorry to bother again.. I tested the "get_authentication_log(api_version=2, factors=["sms_passcode"])" and it works marvelous thank you, how ever I am having trouble trying to fetch the DATA from over 180 days ago, is there any quick fix I can make in my request to get older events? :)

from duo_client_python.

DuoKristina avatar DuoKristina commented on June 19, 2024

The upper limit is 180 days, as noted in the introduction to the Authentication Logs section of the Admin API documentation:

Returns a paged list of authentication log events ranging from the last 180 days up to as recently as two minutes before the API request.

from duo_client_python.

BugWizard avatar BugWizard commented on June 19, 2024

oohh that's the default then? I see. Tank you! .. I should've spotted it in the docs :)

from duo_client_python.

DuoKristina avatar DuoKristina commented on June 19, 2024

No worries. Please close this issue if you don't have any further questions.

from duo_client_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.