common-fate / granted

The easiest way to access your cloud.
https://granted.dev
MIT License
955 stars 90 forks source link

Compatibility problem with VSCode AWS extensions #671

Open Darth-Bobo opened 1 month ago

Darth-Bobo commented 1 month ago

The AWS extensions for VSCode that require sign-in to AWS create session tokens that Granted cannot parse, preventing it from working.

Steps to reproduce:

  1. Authorise an SSO session with "assume" and check you can successfully assume other roles as normal.
  2. Launch VSCode, authorise an AWS extension.
  3. Attempt to assume a new role, you will see an error similar to this: [✘] operation error SSO: GetRoleCredentials, https response error StatusCode: 401, RequestID: 2a2d7c3f-c89d-4b1f-9ef7-8946f0c1369e, UnauthorizedException: Session token not found or invalid
  4. Remove any session token cache files for the extension(s): rm ~/.aws/sso/cache/aws-toolkit-vscode-client*
  5. Assuming a new role now works again.

Granted version: 0.27.0 OS: macOS Sonoma & Ventura

Update: Looking at the contents of the files is appears that the aws-toolkit-vscode* files don't have accessToken or refreshToken defined within them; I'm not sure if this is a change that Amazon have made or not and may be related to the Amazon Q extension.

TimekillerTK commented 1 week ago

I have this same issue. Removing the aws-toolkit-vscode-client* files resolves the problem.

Granted version: 0.27.0 OS: macOS Sonoma