Skip to content
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

aws-sdk-go doens't support new sso-session in a shared config #4649

Closed
ksauzz opened this issue Dec 1, 2022 · 11 comments · Fixed by #4853, #4885 or #4904
Closed

aws-sdk-go doens't support new sso-session in a shared config #4649

ksauzz opened this issue Dec 1, 2022 · 11 comments · Fixed by #4853, #4885 or #4904
Assignees
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available

Comments

@ksauzz
Copy link

ksauzz commented Dec 1, 2022

Describe the bug

2 weeks ago, awscli v2.9.0 was released and introduced sso-session section in $HOME/.aws/config. But it seetms aws-sdk-go doesn't support it yet, and failed to load the config.

Expected Behavior

aws-sdk-go should load sso-session section from a shared config correctly.

Current Behavior

aws-sdk-go just ignored sso-session section, and failed by missing required configuration: sso_region, sso_start_url.

Reproduction Steps

  1. install awscli v2.9.0 or later.
  2. create a shared config by aws configure sso
  3. load the config from aws-sdk-go. I used session manager plugin.

Possible Solution

No response

Additional Information/Context

It would be nice if session manager plugin team in AWS would update aws-sdk-go version after releasing the fix.

SDK version used

v1.40.17

Environment details (Version of Go (go version)? OS name and version, etc.)

Linux

@ksauzz ksauzz added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 1, 2022
@isaiahvita
Copy link
Contributor

@ksauzz thanks for reaching out. would you be able to show us whats in your shared config located at ~/.aws/config? feel free to stub out any sensitive information

@ksauzz
Copy link
Author

ksauzz commented Dec 2, 2022

Our config which hit the issue is the following:

[profile xxx]
sso_session = xxx
sso_account_id = xxxxxxxxxx
sso_role_name = xxxxxxxxxx
region = ap-northeast-1
sso_region = ap-northeast-1
output = json
[sso-session xxx]
sso_start_url = https://d-xxxxxxxxxx.awsapps.com/start
sso_region = ap-northeast-1
sso_registration_scopes = sso:account:access

You can find the similar example here.

@ksauzz
Copy link
Author

ksauzz commented Dec 13, 2022

@avdhoot
Copy link

avdhoot commented Mar 3, 2023

What should users do when an application uses AWS-SDK-GO v1 while AWS CLI is creating a new profile? I will request the maintainer's support both profile/config in v1 SDK.

@kyanar
Copy link

kyanar commented Mar 16, 2023

Looks like the only solution is to copy the sso_start_url and sso_region from the sso-session block, delete the sso-session block (and all references to sso_session_name) and then reauthenticate to allow the SDK-v1 sessions to work. If the sso_session_name is configured at all, AWS CLI puts the authentication token in a location the SDK can't find.

@RanVaknin RanVaknin added workaround-available p3 This is a minor priority issue labels Mar 16, 2023
@akbog
Copy link

akbog commented Mar 29, 2023

This is an increasingly frustrating bug across the AWS CLI/SDK ecosystem

@mericozkayagan
Copy link

any updates on this?

@dongho-jung
Copy link

It's been almost five months and we still have to login repeatedly.. why is this P3 and have minor priority?

@sokopro-vile
Copy link

sokopro-vile commented Jul 5, 2023

I'm also interested, what's the status of this? There were some merged PRs mentioned #4868 & #4875 indicating some kind of handywork in order to fix this, however the first one seemed to also be reverted at some point?

Updating myself: so it seems the #4885 is still open & waiting to be merged to main --> after which we should get the fixes released?

@aajtodd
Copy link
Contributor

aajtodd commented Jul 5, 2023

Yes, when #4885 lands into main it will be made available in the next release.

@github-actions
Copy link

github-actions bot commented Jul 6, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

aws-sdk-go-automation pushed a commit that referenced this issue Jul 7, 2023
===

### Service Client Updates
* `service/dms`: Updates service API, documentation, and paginators
  * Releasing DMS Serverless. Adding support for PostgreSQL 15.x as source and target endpoint. Adding support for DocDB Elastic Clusters with sharded collections, PostgreSQL datatype mapping customization and disabling hostname validation of the certificate authority in Kafka endpoint settings
* `service/glue`: Updates service API and documentation
  * This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation.
* `service/logs`: Updates service API and documentation
  * Add CMK encryption support for CloudWatch Logs Insights query result data
* `service/medialive`: Updates service API and documentation
  * This release enables the use of Thumbnails in AWS Elemental MediaLive.
* `service/mediatailor`: Updates service API and documentation

### SDK Bugs
* `aws/credentials/ssocreds`: Implement SSO token provider support for `sso-session` in AWS shared config.
  * Fixes [4649](#4649)
aws-sdk-go-automation added a commit that referenced this issue Jul 7, 2023
Release v1.44.298 (2023-07-07)
===

### Service Client Updates
* `service/dms`: Updates service API, documentation, and paginators
  * Releasing DMS Serverless. Adding support for PostgreSQL 15.x as source and target endpoint. Adding support for DocDB Elastic Clusters with sharded collections, PostgreSQL datatype mapping customization and disabling hostname validation of the certificate authority in Kafka endpoint settings
* `service/glue`: Updates service API and documentation
  * This release enables customers to create new Apache Iceberg tables and associated metadata in Amazon S3 by using native AWS Glue CreateTable operation.
* `service/logs`: Updates service API and documentation
  * Add CMK encryption support for CloudWatch Logs Insights query result data
* `service/medialive`: Updates service API and documentation
  * This release enables the use of Thumbnails in AWS Elemental MediaLive.
* `service/mediatailor`: Updates service API and documentation

### SDK Bugs
* `aws/credentials/ssocreds`: Implement SSO token provider support for `sso-session` in AWS shared config.
  * Fixes [4649](#4649)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p3 This is a minor priority issue workaround-available
Projects
None yet