-
Notifications
You must be signed in to change notification settings - Fork 4.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
aws2 cli sso login should give option to force new session entirely #9041
Comments
Thanks for your post. I tried this out, but I could use the new permission set just fine. I had an existing SSO user with one permission set. I logged in via the command line, using a profile like this:
Through the AWS console, I associated another permission set to this user account, added another profile to my config file like:
I could then run commands just fine using this new role permission set, without logging in or out again. I'm wondering if there's some other issue, or something else that I'm missing here. I don't think the CLI would have any way to invalidate browser sessions as it does not manage those. |
Sorry @kdaily I have a slightly different workflow where I am experiencing this (I've also edited my original comment for clarity):
should fail with:
because I think aws sso login on the cli doesn't actually cause a fresh login session to occur, because it doesn't actually trigger the termination/invalidation of the currently running user session that the browser is using I can appreciate this could perhaps require a few changes, but in my view the cli should have the power to invalidate a login session (across all clients one may be using) in order to prevent issues such as the case above (where one needs to log out and in, in order for the change to take effect in SSO) - for me it just feels a bit wrong for a new aws sso login attempt on the cli not to be able to deliver this, and for cli users to be effectively stuck with a 'stale' login session until they log in and out on the browser - this can cause difficulties for developers using the cli in this circumstance, until of course their web browser session finally expires, in which case they then may be very surprised to see that the cli then works after a new aws sso login attempt ! |
The code backing the aws-cli/awscli/customizations/sso/login.py Lines 41 to 46 in 99a32dd
So every There's some rather unintuitive ties between sessions vended from the SSO endpoints and the sessions in the browser (e.g. logging out in the browser can invalidate the session the CLI got, etc.) and I'm assuming this is another one of those rough edges. |
I could reproduce your scenario. I'm going to check in with the SSO team to see if I can get some clarification on the behavior. |
Hi @georgewheatcroft, no update to report. Since this seems to be an SSO implementation issue, I'm going to move this ticket to the SDK repository, |
P42423194 |
Strike that, I can still reproduce. |
Reached out to service team for an update. Awaiting response. |
Is your feature request related to a problem? Please describe.
one problem I have encountered with AWS SSO is that when a user has already been mapped against an account, and is then assigned a new permission set against that account via being added to a group which has a permission set against that account, they must log out and log in again in order to be able to access these permissions
Specifically, I experienced this when I was added to a new SSO group with an additional permission set, against an account I already had a permission set mapped to (AWSAdministratorAccess). aws sso login seemingly logged me in on the cli - but I had an old browser session somewhere which hadn't invalidated its session (i.e. I had an existing session which didn't have the new permission set in). attempts to use the new permission set on the CLI failed with:
because the cli seems to be taking the same permissions as my old browser session (which is my default browser). It took a frustratingly long while to find that the cli doesn't actually update the session when one does aws sso login (and they have an existing sso session open on a browser) and that the only way for my cli to be able to access the new permissions was to log out on the browser and then log in again, then do aws sso login again
Describe the solution you'd like
enable the aws cli to be able to invalidate the old session (everywhere) and force a new session as an additional option to aws sso login; e.g.:
The text was updated successfully, but these errors were encountered: