Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
Use regional endpoints for STS #225 (#242)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikn authored and nickatsegment committed Nov 1, 2019
1 parent e5359bb commit 5b487d7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ func (o *OktaClient) AuthenticateProfileWithRegion(profileARN string, duration t
if region != "" {
log.Debugf("Using region: %s\n", region)
conf := &aws.Config{
Region: aws.String(region),
Region: aws.String(region),
Endpoint: aws.String(fmt.Sprintf("https://sts.%s.amazonaws.com", region)),
}
samlSess = session.Must(session.NewSession(conf))
} else {
Expand Down Expand Up @@ -251,9 +252,8 @@ func (o *OktaClient) AuthenticateProfileWithRegion(profileARN string, duration t
return *samlResp.Credentials, sessionCookie, nil
}


func (o *OktaClient) AuthenticateProfile(profileARN string, duration time.Duration) (sts.Credentials, string, error) {
return o.AuthenticateProfileWithRegion(profileARN, duration, "")
return o.AuthenticateProfileWithRegion(profileARN, duration, "")
}

func selectMFADeviceFromConfig(o *OktaClient) (*OktaUserAuthnFactor, error) {
Expand Down

0 comments on commit 5b487d7

Please sign in to comment.