Commit 52f40c2
authored
feat(auth): add console credentials sign-in option to login webview (#8401)
## Problem
Users can use a beginner-friendly interface to authenticate with AWS
Console credentials to obtain temporary credentials, especially for new
AWS users. This GUI-based offers alternative to `aws login` command-line
authentication.
Reference:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sign-in.html
## Solution
- Add "Console credentials - recommended" option to login webview
- Restrict profile name input to alphanumeric, underscore, and hyphen
characters (following [profile name
pattern](https://github.com/keenwilson/aws-toolkit-vscode/blob/89739bc176c28321f64cd672664014d1ddfed533/packages/core/src/auth/consoleSessionUtils.ts#L48))
- Show "Opening AWS sign-in in your default browser..." during
authentication
- Redirect to explorer view upon successful sign-in
Note:
- The UI flow follows the same pattern as IAM credentials setup, with
these key differences:
- Console credentials form takes profile name and region (optional)
- IAM credentials form takes access key and secret key
- Different telemetry emitted for credential source ID:
- Console credentials: 'consoleCredentials'
- IAM credentials: 'sharedCredentials'
- Telemetry for credential source ID is tracked via
aws/aws-toolkit-common#1108
- AWS CLI returns exit code 255 if browser-based authentication is not
completed, this prevents partial/incomplete authentication states
- Reuse `fromLoginCredentials` provider instance to prevent multiple
credential resolution attempts and maintain consistent refresh behavior
at
[resolveProviderWithCancel](https://github.com/aws/aws-toolkit-vscode/blob/eb11eb59318ab83a1f609e472eab760ea38201d1/packages/core/src/auth/providers/sharedCredentialsProvider.ts#L256)
in sharedCredentialsProvider
## UI Changes
- Added "Console credentials - recommended" as first option in login
selection
<img width="1122" height="633" alt="1-start"
src="https://github.com/user-attachments/assets/3d46b1ee-9730-4834-ac64-328a5b92227c"
/>
- Created profile name input with validation for letters, numbers, - and
_
- Made region selection optional with us-east-1 default
<img width="1122" height="631" alt="4-console-profile"
src="https://github.com/user-attachments/assets/f1acfffb-40b6-4f7e-a87a-96da6b0ff59d"
/>
- Shows clear guidance during browser authentication flow
<img width="1150" height="765" alt="Opening AWS sign-in in your default
browser."
src="https://github.com/user-attachments/assets/9f04fea4-0980-4eef-9b3f-e5c2caa9fbc5"
/>
- Attempt to update AWS CLI if the version < 2.32.0
<img width="1086" height="710" alt="Screenshot 2025-12-11 at 4 31 17 PM"
src="https://github.com/user-attachments/assets/77cbc5b6-b238-4db1-bc21-d178081bc298"
/>
### Known Issue: Windows PATH Environment After AWS CLI Installation
When installing or updating AWS CLI v2 through the toolkit on Windows
machine within a managed enterprise or workspace environment, the
installation may appear successful, but users receive the error:
```
[error] aws.toolkit.auth.consoleLogin: Error: Failed to verify or install AWS CLI [CliInstallFailed]
-> Error: Could not verify installed CLIs
```
This typically occurs because the installer successfully places the
necessary files in the default directory (`C:\Program
Files\Amazon\AWSCLIV2\`), but security policies or user permissions
within the workspace prevent the installer from correctly or immediately
updating the system's PATH environment variable. The command prompt
doesn't know where to look for the `aws.exe` file.
You can verify the installation using the full path and contact your IT
support to add the installation path (`C:\Program
Files\Amazon\AWSCLIV2\`) to the System variables `PATH` environment
variable.
```powershell
"C:\Program Files\Amazon\AWSCLIV2\aws.exe" --version
```
---
- Treat all work as PUBLIC. Private `feature/x` branches will not be
squash-merged at release time.
- Your code changes must meet the guidelines in
[CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines).
- License: I confirm that my contribution is made under the terms of the
Apache 2.0 license.1 parent 1771f0a commit 52f40c2
File tree
13 files changed
+305
-72
lines changed- packages
- core/src
- auth
- providers
- login/webview/vue
- amazonq
- toolkit
- toolkit/.changes/next-release
13 files changed
+305
-72
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
57 | 58 | | |
| 59 | + | |
58 | 60 | | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
64 | 63 | | |
65 | | - | |
66 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| |||
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
228 | 244 | | |
229 | 245 | | |
230 | 246 | | |
| |||
Lines changed: 26 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | 93 | | |
95 | 94 | | |
96 | 95 | | |
| |||
358 | 357 | | |
359 | 358 | | |
360 | 359 | | |
361 | | - | |
| 360 | + | |
362 | 361 | | |
363 | 362 | | |
364 | 363 | | |
| |||
398 | 397 | | |
399 | 398 | | |
400 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
401 | 407 | | |
402 | 408 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 409 | + | |
410 | 410 | | |
411 | 411 | | |
412 | 412 | | |
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
| 422 | + | |
422 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
423 | 437 | | |
424 | 438 | | |
425 | 439 | | |
| |||
440 | 454 | | |
441 | 455 | | |
442 | 456 | | |
443 | | - | |
444 | | - | |
445 | | - | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
| 457 | + | |
| 458 | + | |
451 | 459 | | |
452 | 460 | | |
453 | 461 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
174 | 176 | | |
175 | 177 | | |
176 | 178 | | |
| |||
0 commit comments