-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support programmatic AWS SSO authentication in botocore v1 without AWS CLI v2 #1923
Comments
Moving the SSO provider into botocore is definitely on our radar, specifically the first note about being able to use the identity from an As for point 3, could you expand on what you mean by a process provider for alternative auth schemes? Pending what you mean this may require additional support from the SSO API. |
I'm slightly confused—the CLI v2 is not yet GA, but the support it requires from As an example for a process provider, people implement screen-scraping against ADFS to be able to prompt people for passwords inside the terminal. The AWS security blog has even featured such solutions. This would still be possible given device flow for SSO. |
To clarify, I meant that we have the intention of bringing the SSO credential provider into the current major version of botocore (v1). At the very least the ability to read the cached SSO credentials from an |
Checking back in on this as the CLI v2 has gone GA. |
I'm glad the ability to read cached AWS SSO credentials has been brought in to botocore 1.17, but I'd still like to see this support grow to the original scope of this issue, which is that an SDK-using application could trigger dispatch to browser for authentication, so that the user doesn't have to also use the AWS CLI. At the very least, bringing |
I would like to voice support for this as well. We're exploring AWS SSO and it would be fantastic if botocore could kick off the SSO auth flow so we don't have to either redirect users to |
Following up on this now that the provider has been back ported into botocore v1. For now, we have no immediate plans to expose the interfaces to programmatically resolve SSO credentials and store them in the shared caching location beyond the credential provider. There's a few reasons we've decided to keep these private and here are some of the highlights:
Realistically, only one process needs to refresh the underlying SSO login session to ensure the credential provider can exchange for credentials using the shared cached session token. That being said, I definitely agree that there are improvements to be made on the current workflow. Ideally, in my mind this would be some kind of daemon that monitors login sessions and can notify the user when their credentials may be close to expiration to refresh the login session (e.g. via notifications, the task/menu bar, etc). As a question, is there anything specifically about using the CLI v2 to perform the SSO login that's a hard blocker? |
All of these concerns make sense. The problem with relying on the CLI v2 to perform SSO login is that a program a developer creates may not have CLI users as its audience (e.g., a GUI application), and even if it does, the AWS CLI v2 has an idiosyncratic install process that will be a completely divergent step in the program setup process. I'd be happy with an AWS SSO daemon, especially if its installer was more friendly for users less familiar with the CLI. I'd be happy to help build such a thing, in fact. |
Thanks for your response, @joguSD, it makes a lot of sense. I'm not blocked at the moment, no. I would also be curious to at least follow along with development of a daemon (if not contribute a PR or two). |
@joguSD I made a prototype of a GUI application that refreshes AWS SSO tokens. https://github.com/benkehoe/aws-sso-login-gui |
@joguSD @benkehoe just in case this helps, here is my method for solving this kind of issue. i include expiration timestamp in the storage with the token, could check that timestamp to alert for expiration: |
@0xW1sKy I have written |
@benkehoe I had been looking for ways to bring up our local development stacks with our SSO users. |
All code you use that uses boto3 reads those files. The only unique thing
and that's relying on a profile configured to use AWS SSO, that will load the token from That's not to dismiss concerns of repository compromise, but I don't think Happy to have a longer discussion over on the repo if you want. |
@benkehoe that's exactly how simple it is to compromise the token. Public repositories have become a handy instrument for malware distribution like token grabbers and env variable stealers. My question is here again if we can trust in |
I'm looking forward to the AWS CLI v2 allowingaws login
to connect with AWS SSO. I'm also excited that the auth token retrieved by the CLI is managed by botocore, because it means scripts using the boto3 SDK can be run with the identity fromaws login
. However, it would be great if scripts could manage their auth directly without involving the CLI.With botocore 1.17, support for loading credentials cached by
aws sso login
has been added. This still means that Python applications cannot initiate AWS SSO auth, requiring their users to also install and understand the AWS CLI.I'm asking for three things:
SSOTokenFetcher.on_pending_auth
hook a provider-based system like the one for credentials.The text was updated successfully, but these errors were encountered: