Repository navigation
Changed the default value of SSOAWSCredentialsOptions.SupportsGettingNewToken as false and improved error messaging if required SSO options are missing while generating new credentials. - #3737
Merged
dscpinheiro merged 1 commit intoApr 4, 2025
Conversation
dscpinheiro
reviewed
Apr 2, 2025
ashishdhingra
force-pushed
the
user/ashdhin/V4-SSO-BetterException-3535
branch
from
April 3, 2025 18:33
8cfa412 to
df57575
Compare
Contributor
Author
|
@dscpinheiro @afroz429 Addressed review comments in latest commit. Please review. I will trigger fresh dry-run. |
afroz429
approved these changes
Apr 3, 2025
ashishdhingra
force-pushed
the
user/ashdhin/V4-SSO-BetterException-3535
branch
from
April 3, 2025 20:13
df57575 to
9098bff
Compare
dscpinheiro
reviewed
Apr 3, 2025
…NewToken as false and improved error messaging if required SSO options are missing while generating new credentials.
ashishdhingra
force-pushed
the
user/ashdhin/V4-SSO-BetterException-3535
branch
from
April 3, 2025 23:42
9098bff to
3f7e3de
Compare
dscpinheiro
approved these changes
Apr 4, 2025
3 of 10 tasks
Merged
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
SSOAWSCredentialsOptions.SupportsGettingNewTokenasfalseTest Scenarios:
Using Amazon.Extensions.NETCore.Setup package (customer's scenario)
Customer would use
aws sso loginand then rely onCredentialsProfileStoreChainfactoryIn this case, since now
SSOAWSCredentialsOptions.SupportsGettingNewTokenwould resolve tofalse, it would eventually throwAmazonClientExceptionwith message:SSO Token has expired and failed to refreshwhen token is expired.No valid SSO Token could be found.where no token is found.Customer explicitly created SSO credentials (refer example at https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/sso-tutorial-app-only.html)
AWS Toolkit for Visual Studio and PowerShell already explicitly set
SSOAWSCredentialsOptions.SupportsGettingNewTokentotrue.IMPORTANT: We would also need to update the examples in V4 developer guide at Tutorial for SSO using only .NET applications (this is a link from V3 developer guide, use similar link from V4 developer guide) to explicitly set
ssoCredentials.Options.SupportsGettingNewToken = true;as the default value is false. (expand List Amazon S3 buckets and List IAM users collapsible sections)NOTE: There is perhaps another issue. The API documentation for Profile states that
Represents a profile in the configuration file. For example in ~/.aws/config [profile foo] name = value Profile profile = new Profile("foo"); When this is set on the ClientConfig and that config is passed to the service client constructor the sdk will try to find the credentials associated with the Profile.Name property If set, this will override AWS_PROFILE and AWSConfigs.ProfileName.When I use code like below:
It doesn't consider the passed profile based on logic here (for V4) and here (for V3).
Motivation and Context
GitHub issue/discussion:
Testing
Dry-run
DRY_RUN-a741bd15-07fd-48e3-b260-603408b4134bcompleted successfully.Screenshots (if appropriate)
Types of changes
Checklist
License