From 79cdc4f5d6c5f14f8fc7a2e0e11b5b8c8e8f96b2 Mon Sep 17 00:00:00 2001 From: Raymond Mak Date: Wed, 3 Jan 2024 12:49:25 -0500 Subject: [PATCH] Enable AWS SSO support --- cmd/aws-sigv4-proxy/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmd/aws-sigv4-proxy/main.go b/cmd/aws-sigv4-proxy/main.go index 62615a87..fd59deff 100644 --- a/cmd/aws-sigv4-proxy/main.go +++ b/cmd/aws-sigv4-proxy/main.go @@ -67,6 +67,10 @@ func main() { log.SetLevel(log.DebugLevel) } + sessionOptions := session.Options{ + SharedConfigState: session.SharedConfigEnable, + } + sessionConfig := aws.Config{} if v := os.Getenv("AWS_STS_REGIONAL_ENDPOINTS"); len(v) == 0 { sessionConfig.STSRegionalEndpoint = endpoints.RegionalSTSEndpoint @@ -74,7 +78,8 @@ func main() { sessionConfig.CredentialsChainVerboseErrors = aws.Bool(shouldLogSigning()) - session, err := session.NewSession(&sessionConfig) + sessionOptions.Config.MergeIn(&sessionConfig) + session, err := session.NewSessionWithOptions(sessionOptions) if err != nil { log.Fatal(err) }