Coder Social home page Coder Social logo

Comments (4)

DuoKristina avatar DuoKristina commented on September 3, 2024

Hi matc,

You're right, this demonstration client doesn't include support for an authenticated proxy. You're welcome to fork and include support for those headers.

from duo_client_python.

matc avatar matc commented on September 3, 2024

Hi Kristina,

Thanks for the quick response and for looking into this for me. I will take a look tomorrow to evaluate forking this Duo client vs building new with proxy auth on a more generic client and follow up. Closing out this ticket now :)

Thanks again!
Mat

from duo_client_python.

BradleyHiggins avatar BradleyHiggins commented on September 3, 2024

This worked for me, using basic auth with a squid3 proxy:

auth_api.set_proxy('myproxy.local.net',
        port='8080',
        headers={
            "Proxy-Authorization":
            "Basic " + base64.b64encode(b"proxyUsername:proxyPassword").decode("utf-8")
        },)

Set the headers param in the set_proxy call, which expects a dictionary. Keys are HTTP Header names, and values are the associated header value. I tested this with python 3. You may need to tweak it for python 2.

This will work with a CONNECT proxy only. Duo's API code wants to directly validate the SSL connection to Duo's servers (instead of trusting the proxy to validate the upstream connection). HTTP CONNECT helps accomplish that.

If the connection between your API and proxy is (non-SSL) HTTP, be aware that this will put the proxy user's password on the network. The HTTPS connection end-to-end between the API client and Duo's server will still be secure, even with a (non-SSL) HTTP proxy.

from duo_client_python.

matc avatar matc commented on September 3, 2024

@BradleyHiggins - this worked beautifully on python 2!! Thank you so much for sharing this with me 🥇👏🏼
Really appreciate you help here, saved me quite a significant amount of work!

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.