You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add OAuth Authorization Code + PKCE flow for SSO login
Replace the device code flow as the default SSO login method with the
Authorization Code Grant + PKCE flow, matching the AWS CLI's Nov 2024
update. This provides a smoother UX by skipping manual code entry —
the browser redirects back automatically via a temporary localhost
callback server.
The device code flow is preserved as a fallback via --use-device-code
flag or automatic headless environment detection (SSH, Docker, CI).
Key changes:
- New LoginWithAuthorizationCode function implementing RFC 7636 PKCE
- Extracted browser-opening logic into reusable browser.go module
- Headless environment detection for automatic flow selection
- Upgraded ssooidc SDK to v1.35.15 for authorization_code grant support
- Security headers (CSP, X-Content-Type-Options, X-Frame-Options) on
callback pages
- Comprehensive tests including RFC 7636 test vectors and XSS prevention
Closes#779
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: make authorization code + PKCE flow opt-in instead of default
Device code flow remains the default SSO login method. The PKCE
authorization code flow is now opt-in via --use-authorization-code
flag or UseAuthorizationCode config setting, reducing risk of
breaking existing users behind proxies or restricted networks.
- Add UseAuthorizationCode to Config and ConfigOpts structs
- Add --use-authorization-code flag to login, assume, generate, populate
- Add --use-device-code flag to generate and populate commands
- Thread config through all ConfigOpts construction sites
- Log warning when headless detection overrides PKCE preference
- Remove SSOSessionName as implicit PKCE trigger in assume path
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: pkg/assume/entrypoint.go
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -59,6 +59,7 @@ func GlobalFlags() []cli.Flag {
59
59
&cli.StringSliceFlag{Name: "browser-launch-template-arg", Usage: "Additional arguments to provide to the browser launch template command in key=value format, e.g. '--browser-launch-template-arg foo=bar"},
60
60
&cli.BoolFlag{Name: "skip-profile-registry-sync", Usage: "You can use this to skip the automated profile registry sync process."},
61
61
&cli.StringSliceFlag{Name: "attach", Usage: "Attach justifications to your request, such as a Jira ticket id or url `--attach=TP-123`"},
62
+
&cli.BoolFlag{Name: "use-authorization-code", Usage: "Use authorization code flow with PKCE for SSO login"},
0 commit comments