Skip to content

config: accept login_session profiles as an assume role source_profile - #3447

Open
alext wants to merge 1 commit into
aws:mainfrom
junohq:fix_login_session_with_source_profile
Open

config: accept login_session profiles as an assume role source_profile#3447
alext wants to merge 1 commit into
aws:mainfrom
junohq:fix_login_session_with_source_profile

Conversation

@alext

@alext alext commented Jun 12, 2026

Copy link
Copy Markdown

Summary

Fixes #3446

A profile using login_session (aws login credentials) cannot be used as the source_profile of an assume-role profile. config.LoadDefaultConfig fails with:

failed to load assume role <role-arn>, of profile <source>, <nil>

aws login support (#3230) added login_session as a direct credential provider, but SharedConfig.hasCredentials() - which validates that a linked source profile actually supplies credentials - wasn't updated to recognise it. As a result a login-session source profile is treated as having no credentials and the assume-role chain fails to load. The AWS CLI / botocore resolve the same configuration successfully.

A single profile combining login_session + role_arn (no source_profile) already works, because that path doesn't go through the source-profile validation; only the source_profile form is affected.

Fix

Fix this by including a check for c.LoginSession in hasCredentials() to add to the checks for the various other credential sources.

A profile that sources its credentials from `aws login` (login_session) was
rejected when used as the source_profile of an assume-role profile, with config
loading failing as:

    failed to load assume role <role-arn>, of profile <source>, <nil>

aws login support (aws#3230) wired login_session in as a direct credential provider
but did not update SharedConfig.hasCredentials(), which gates whether a linked
source profile supplies credentials. The source profile was therefore treated as
having no credentials and the assume-role chain failed to load. The AWS CLI and
botocore resolve the same configuration successfully.

Add a login_session case to hasCredentials(), alongside the existing
credential_process, web_identity_token_file and SSO cases.
@alext
alext requested a review from a team June 12, 2026 15:46

@wty-Bryant wty-Bryant left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update lgtm, running ci and waiting for approval from our login cred implementor if that's an expected cross SDK behavior

@alext

alext commented Jun 30, 2026

Copy link
Copy Markdown
Author

Hi, what's required before this can be merged? Just want to make sure you're not waiting on me for anything. Thanks.

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.

Login session (aws login) credentials rejected when used as source_profile for an assume-role profile

3 participants