Skip to content

Record the sign-in region in the cached login token - #10767

Open
AndrewAsseily wants to merge 2 commits into
v2from
nyandrew/login-signin-region
Open

AndrewAsseily wants to merge 2 commits into
v2from
nyandrew/login-signin-region

Conversation

@AndrewAsseily

Copy link
Copy Markdown
Contributor

Issue #, if available:

Description of changes:

  • aws login caches a refresh token, and refresh tokens are regional: they have to be redeemed in the region they were issued in. Nothing currently records where the login happened, so a refresh goes to whatever region resolves when it runs. This writes that region into the cached token as signInRegion. The value is the same region used to build the signin client for the login itself, so it reflects where the sign-in actually went

  • Nothing reads the field yet: the SDK side is separate. On its own this is backwards compatible, since existing readers ignore unknown fields in the token file and tokens cached before this change just won't have it.

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

@AndrewAsseily
AndrewAsseily requested a review from a team as a code owner October 15, 2026 21:25
@ashovlin

Copy link
Copy Markdown
Member

Should we handle the CLI's own refresh flow while we're here?

config = botocore.config.Config(
signature_version=botocore.UNSIGNED,
)
client = self._client_creator(
'signin',
config=config,
)

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.

2 participants