AWS Builder ID credentials expire in one day
Problem
The credentials provided by the AWS Builder ID expire way too quickly. Every morning I open VSCode, the AWS Toolkit plugin bothers me to be re-authenticated, having to click several dialogs in VSCode, then it sends me to the browser where I still have to click three-four times, then I manually have to switch back to VSCode window.
Extend the validity period of these credentials or implement some renewal mechanism, like all decent authentication systems do.
Steps to reproduce the issue
- Log in to AWS Toolkit with AWS Builder ID
- Wait one day
Expected behavior
I'm still logged in to the AWS Toolkit after one day.
System details (run the AWS: About Toolkit command)
- OS: Darwin arm64 21.6.0
- Visual Studio Code extension host: 1.86.2
- AWS Toolkit: 2.11.0
- node: 18.17.1
- electron: 27.2.3
This is unusual. Are you certain you aren't authenticating through Identity Center (SSO)? The default expiration there is 8 hours, which is controlled by the Identity Center administrator.
Can you provide the Toolkit logs?
- In VSCode settings, ensure that "aws log level" is "debug".
- Perform the steps to reproduce the issue.
- Use the
AWS: View Toolkit Logscommand to get the logs. - Remove any private info from the logs.
Hello, here is the log and screenshots of reproducing the bug.
I start with clicking on the expired banner in the status bar:
It pops up the switch connection dropdown, I select AWS Builder ID:
It asks me two confirmation:
(In effect the URL suggest a redirection to the SSO, but I asked for the Builder ID)
It redirects me the following URL: https://view.awsapps.com/start/user-consent/authorize.html?clientld=... and after two confirmation...
It successfully authenticate the VSCode app and for one day I'm again OK.
The extracted logs:
Thanks. Need the logs for after the expiration happens.
I have the same issue required re-validate AWS connection every time VS Code starts, although I haven't used code whisperer yet. Here's the logs from your instruction above.
2024-03-05 08:50:44 [DEBUG]: command not found: "aws.amazonq.refresh" 2024-03-05 08:50:44 [DEBUG]: command not found: "aws.amazonq.refreshRootNode" 2024-03-05 08:50:44 [DEBUG]: codewhisperer: Connection is valid = false, connection is undefined = true, secondaryAuth connection expired = false 2024-03-05 08:50:44 [DEBUG]: codewhisperer: Connection expired = false, secondaryAuth connection expired = false, connection is undefined = true 2024-03-05 08:50:44 [DEBUG]: codewhisperer: Connection expired = false, secondaryAuth connection expired = false, connection is undefined = true
my AWS Toolkit version is 2.12.0 2024-02-29.