Describe the feature
Currently, aws sso login goes through the log in process whenever it's called. So if I have two profiles foo and bar that share the same AWS SSO configuration (i.e., sso_start_url and sso_region), when I call aws sso login --profile foo, it will pop up a browser window, log me in, etc., resulting in a valid token being cached in ~/.aws/sso/cache. If I then call aws sso login --profile bar (or aws sso login --profile foo again, for that matter), despite having a valid token for that config, it will go through the entire login process again, resulting in a new token.
Use Case
It's unnecessary work, and it's exacerbated by the argument to aws sso login being --profile, which leads people to think they need to call it whenever they're using a particular profile (I wrote an explainer to help people understand they don't need to do that).
Proposed Solution
aws sso login should check the expiration of the cached token, and exit out successfully if the token is not expired. There should be a --force-refresh option to override this.
Other Information
No response
Acknowledgements
CLI version used
N/A
Environment details (OS name and version, etc.)
N/A
Describe the feature
Currently,
aws sso logingoes through the log in process whenever it's called. So if I have two profilesfooandbarthat share the same AWS SSO configuration (i.e.,sso_start_urlandsso_region), when I callaws sso login --profile foo, it will pop up a browser window, log me in, etc., resulting in a valid token being cached in~/.aws/sso/cache. If I then callaws sso login --profile bar(oraws sso login --profile fooagain, for that matter), despite having a valid token for that config, it will go through the entire login process again, resulting in a new token.Use Case
It's unnecessary work, and it's exacerbated by the argument to
aws sso loginbeing--profile, which leads people to think they need to call it whenever they're using a particular profile (I wrote an explainer to help people understand they don't need to do that).Proposed Solution
aws sso loginshould check the expiration of the cached token, and exit out successfully if the token is not expired. There should be a--force-refreshoption to override this.Other Information
No response
Acknowledgements
CLI version used
N/A
Environment details (OS name and version, etc.)
N/A