Open avoidik opened 2 years ago
it works even after SSO session has expired if I remove this line from ~/.aws/config
sso_session = bbbb-cli
aws sso login --profile aaaa
instead?aws-sso-util check --check-profile aaaa
?this is what I've got for expired session (I decided to run second item first)
$ aws-sso-util check --check-profile aaaa
aws-sso-util: v4.30.0; aws-sso-lib: v1.13.0; time: 2022-12-01T11:42:16Z
Configuration for profile aaaa:
Start URL: https://xyz.awsapps.com/start
Region: eu-central-1
Account ID: 123456789012
Role name: iam-role-name
AWS SSO instance start URL https://xyz.awsapps.com/start from CLI-specified profile aaaa and region eu-central-1 from CLI-specified profile aaaa, from specifier https://xyz.awsapps.com/start from CLI-specified profile aaaa and region eu-central-1 from CLI-specified profile aaaa
AWS SSO token cache entry is valid until 2022-12-01T18:39:20Z (cached at 2022-12-01T10:39:26Z)
Access found for iam-role-name in account 123456789012 (aaaa-bbbb-ppp)
$ aws sts get-caller-identity
Error when retrieving token from sso: Token has expired and refresh failed
then I run
$ aws sso login --profile aaaa
which eventually fixed the expired session issue
while following a sso login journey in a browser I saw that aws sso login --profile aaaa
has been using bbbb-cli
in approval process, but aws-sso-util login
isn't
A change to the CLI/boto3 to support refresh tokens seems to be the cause, but I'm not going to be able to figure out the fix for a couple days at least.
I think I can summarize this issue to - for some reason aws-sso-util login
is ignoring session profile
As long as you signed in to IAM Identity Center and those cached credentials are not expired, the AWS CLI automatically renews expired AWS credentials when needed. However, if your IAM Identity Center credentials expire, you must explicitly renew them by logging in to your IAM Identity Center account again. by using following method:
$ aws sso login --profile urprofilename The AWS CLI opens your default browser and verifies your IAM Identity Center log in.
you can verify same by using following command: aws s3 ls --profile urprofilename
Yup, that's what I have preventively been doing, but leveraging the tool itself, so that it picks a correct SSO profile automatically
$ aws-sso-util login
i have installed aws-sso-util utility and configured my profile aws-sso-util configure profile, after configuration when i used aws-sso-util login,it attempted to login IAM Identity Center, once login succeed, it saying Login succeeded, valid until 2024-02-13 19:36 India Standard Time, does it again temporary access , cant make it as permanent ?
wht i felt aws-sso-util configure profile and aws configure sso , both does same job , also aws sso login --profile and aws-sso-util login ,again does same job, no difference.
I have somewhat of a similar issue, and it is described here: https://github.com/aws/aws-cli/issues/7656#issuecomment-1972470467
For those interested, there seems to be a possible solution of increasing the default IAM session time.
hello,
could you please suggest what I'm doing wrong here? my setup only works while the first SSO session is active, after that I'm getting the following, for example:
my
aaaa
profile was initially configured in this way:if I'd remove
~/.aws/
folder and try again to reconfigure the profile it works, but again while the SSO session is activesample
~/.aws/config
filemy
~/.profile
has these environment variables