-
Notifications
You must be signed in to change notification settings - Fork 656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SSO Cache filename should be based on sso_session
in addition to sso_start_url
#2609
Comments
Hi @schrobot , It's not clear under which circumstances the Go SDK is not able to resolve certain filenames? I have used the For example:
and
I'm able to use both of these profiles to run s3 code perfectly using the SDK. Does this only manifest when using the Are you able to write an in-depth reproduction just using the SDK without credential helper that can exhibit this behavior? Thanks, |
Hi, thx for your feedback, I just checked v2's implementation of sso cred provider, current config cred resolution will resolve a sso token provider, which use the session name to generate the cached token path. According to your workflow, the session name should be respected to get the cached token file. Could you clarify what version of sdk go v2 are you using in your repo? If it is too old, the sso token provider might not present to detect the sso session and resolve cached file from that |
Thank you for getting back so quickly, and for those pointers. I took a look at the version the helper uses, and what's committed to |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
The SSO cache files in
~/.aws/sso/cache
are assumed to have filenames based only on thestartUrl
. Other SDKs, namely the Python SDK, and seemingly what the AWS CLI uses, actually use thesso_session
if provided, and fallback to thesso_start_url
otherwise. This leads to issues where if I login via the aws CLI, with a profile that has asso_session
configured, tools that use the go SDK, like https://github.com/awslabs/amazon-ecr-credential-helper, fail to correctly find my cached credentials and produce authentication errors.See https://github.com/boto/botocore/blob/master/botocore/utils.py#L3354 and
https://github.com/aws/aws-sdk-go-v2/blob/main/credentials/ssocreds/sso_credentials_provider.go#L98
Expected Behavior
The
go
SDK should generate the same filenames as the other SDKs and CLI.Current Behavior
The
go
SDK computes the filename only based on the start URL, which makes it unable to find the right cached credential file produced by the CLI.Reproduction Steps
~/.aws/config
enabled for SSO, that has ansso_session
aws sso login --profile <that profile>
retrieve
passing in the info for that profile (which can only include the account, startUrl, etc; but won't include the session name)Possible Solution
Replicate the logic in the botocore SDK
Additional Information/Context
No response
AWS Go SDK V2 Module Versions Used
latest version has this issue
Compiler and Version used
n/a
Operating System and version
Mac
The text was updated successfully, but these errors were encountered: