Skip to content

Commit

Permalink
Modify resolving sso credential logic (#4917)
Browse files Browse the repository at this point in the history
* Modify and merge resolving sso credential logic
  • Loading branch information
wty-Bryant committed Jul 27, 2023
1 parent 14bc14a commit 1b1dc9b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
### SDK Enhancements

### SDK Bugs
* `aws/session`: Modify resolving sso credential logic to fix stack overflow bug while configuring shared config profile via env var.
* Fixes [4912](https://github.com/aws/aws-sdk-go/issues/4912)
5 changes: 4 additions & 1 deletion aws/session/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ func resolveSSOCredentials(cfg *aws.Config, sharedCfg sharedConfig, handlers req
if err != nil {
return nil, err
}
mySession := Must(NewSession())
// create oidcClient with AnonymousCredentials to avoid recursively resolving credentials
mySession := Must(NewSession(&aws.Config{
Credentials: credentials.AnonymousCredentials,
}))
oidcClient := ssooidc.New(mySession, cfgCopy)
tokenProvider := ssocreds.NewSSOTokenProvider(oidcClient, cachedPath)
optFns = append(optFns, func(p *ssocreds.Provider) {
Expand Down

0 comments on commit 1b1dc9b

Please sign in to comment.