Skip to content

[v2] Add redirect port option to SSO and login commands - #10462

Open
ixxq wants to merge 2 commits into
aws:v2from
ixxq:feat/sso-redirect-port
Open

ixxq wants to merge 2 commits into
aws:v2from
ixxq:feat/sso-redirect-port

Conversation

@ixxq

@ixxq ixxq commented Jul 2, 2026

Copy link
Copy Markdown

Issue #, if available: Fixes #10433

Description of changes: Adds a --redirect-port option to aws sso login, aws configure sso, and aws login so users can specify a fixed localhost port for the authorization code callback server and configure port forwarding in advance.

When the option is omitted, the existing behavior is preserved and the callback server continues to bind to a randomly selected available port. Login flows that do not use a callback server are unchanged.

Invalid port values are rejected before starting the login flow. SSO session configuration support is not included in this PR.

Added unit and functional test coverage for the CLI option across all three commands, invalid port values, and binding the callback server to the requested port.

Validated with targeted pytest, ruff, and pre-commit checks on macOS.

This contribution was prepared with assistance from AI tools and reviewed by @ixxq.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

ixxq and others added 2 commits September 22, 2026 01:16
Add --redirect-port to aws sso login and aws configure sso so users can
select a fixed callback port and configure port forwarding in advance.

Validate the port before prompting or starting authentication. Preserve
random port selection when the option is omitted, and leave device code
flows unchanged.
Extend --redirect-port to aws login so console-based login can use the
same fixed-port forwarding setup as SSO login.

Reuse the shared option and validation, passing the selected port to
the same-device callback server. Leave the --remote flow unchanged.
@ashovlin
ashovlin marked this pull request as draft September 21, 2026 21:21
@ixxq
ixxq force-pushed the feat/sso-redirect-port branch from b565da1 to 986ba2f Compare September 23, 2026 23:10
@ixxq ixxq changed the title [v2] Add redirect port option to sso login [v2] Add redirect port option to SSO and login commands Sep 23, 2026
@ixxq
ixxq marked this pull request as ready for review September 23, 2026 23:20
@ixxq

ixxq commented Sep 23, 2026

Copy link
Copy Markdown
Author

Hi @ashovlin, I've updated this PR as discussed in #10636:

  • Added --redirect-port support to aws login and aws configure sso.
  • Removed sso_redirect_port configuration support for now.

I've marked it ready for review. Could you take a look when you have a chance?

I also saw the callback binding and error-message comments on #10636. I've left those existing behaviors unchanged for now. Would you prefer to address those concerns in this PR or separately?

Thanks!

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

sso login: allow to customize localhost port for redirect_uri

2 participants