Skip to content

Guidance on using sso profile #3318

Answered by dscpinheiro
KieranFleckney asked this question in Q&A
Discussion options

You must be logged in to vote

The SDK does support the newer format, there are a couple of documentation pages in our developer guide with examples (and please leave feedback there if you think it can be improved): https://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/sso-tutorial-cli-and-app.html

The main difference between the example there and your code is that you don't need to use the SharedCredentialsFile class, CredentialProfileStoreChain should be used instead as it retrieves the profile correctly:

var chain = new CredentialProfileStoreChain();
chain.TryGetAWSCredentials("default", out AWSCredentials profileCredentials);

using var s3Client = new AmazonS3Client(profileCredentials, RegionEndpoint.EUWest1);
v…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KieranFleckney
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants