Skip to content
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

assume {aws-profile} does not work the 1st time error: invalid character '\x1b' looking for beginning of value #725

Open
MDBeudekerCN opened this issue Aug 7, 2024 · 0 comments

Comments

@MDBeudekerCN
Copy link

Whenever I run assume the 1st time of the day i get the following response:

> assume                                                                                                              

? Please select the profile you would like to assume: ${profile}            
[i] To assume this profile again later without needing to select it, run this command:
> assume ${profile}
[✘] error refreshing AWS IAM Identity Center token: operation error SSO OIDC: CreateToken, https response error StatusCode: 400, RequestID: 12334, InvalidGrantException: 
[i] If the browser does not open automatically, please open this link: https://device.sso.eu-west-1.amazonaws.com/?user_code={redacted}
[i] Awaiting AWS authentication in the browser
[i] You will be prompted to authenticate with AWS in the browser, then you will be prompted to 'Allow'
[i] Code: {redacted}
{"Version":1,"AccessKeyId":"${AccesskeyID}","SecretAccessKey":"${secretaccesskey}","SessionToken":"IQ...redacted...30F+/paO7CmYqj1CZeL2ATryApF5FvcniUq4mDxR4qNvSw0lEA=","Expiration":"2024-08-07T22:16:52+02:00"}
, error: invalid character '\x1b' looking for beginning of value

I can't get anything from my aws account. Running aws s3 ls returns something like invalid token
When I then do another assume action

❯ assume

? Please select the profile you would like to assume: ${profile}
[i] To assume this profile again later without needing to select it, run this command:
> assume ${profile}
[✔] [${profile}](eu-central-1) session credentials will expire in 1 hour

Things work just fine.

I am using WSL an granted is installed using brew.

Can it be that something goes wrong in the fetching of the token on the first try? Apparently i get a '\x1b' character that is not expected but I'm unsure at what part this gets included.

The token I get at the first try does seem to be valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant