cevoaustralia / aws-google-auth

Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
MIT License
537 stars 181 forks source link

Question: importing and using in a python script? #116

Closed johnnyplaydrums closed 5 years ago

johnnyplaydrums commented 5 years ago

Hey folks! First off, thanks for this awesome project! We currently have a python CLI we've developed to make it easier for our engineers to interact with our AWS infrastructure. Do you have a defined workflow for using this package in a python script (importing it and calling methods directly), instead of through the CLI command? We could use subprocess.call or something similar to invoke the CLI command, but it'd be much nicer if we can plug right into the python methods. Any thoughts?

Thank you :)

johnnyplaydrums commented 5 years ago

Another question: We currently use an SSO provider to log in to Google (although we're slowing switch to Google SSO, which is why this module could be very helpful for us). Can I use your module to log into google through an SSO provider?

stevemac007 commented 5 years ago

Hi @johnplaydrums - there should be no reason you couldn't use this embedded in your python library, at worst you could call the cli function passing through the arguments simulating the command line call.

The main issue I see is that the tool is designed to be interactive, so if you want to change the interface from the CLI you might need to make some changes.

I'm all for a refactoring of the library that separates the capability from the user interface (CLI in this case) - but is way beyond the time currently available.

With respect to question 2 - This tool is a reverse engineer of the Google SSO workflow to gain a SAML document which is then used to auth into AWS, you'll probably find other SSO providers have some tooling for CLI access which could be extended to then auth into AWS - but again, beyond the scope of this project at the moment.

johnnyplaydrums commented 5 years ago

Ok great, thank you for the prompt response! All makes sense. I'll close this out for now 👌