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

Commit

Permalink
Merge pull request #113 from segmentio/Fauzyy/fix-missing-saml-url-error
Browse files Browse the repository at this point in the history
  • Loading branch information
Fauzyy authored Jan 24, 2019
2 parents a0b71df + f87f74c commit 959c738
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func NewOktaClient(creds OktaCreds, oktaAwsSAMLUrl string, sessionCookie string,
} else if creds.Domain != "" {
domain = creds.Domain
} else {
return &OktaClient{}, errors.New("either creds.Organization (deprecated) or creds.Domain must be set, and not both")
return &OktaClient{}, errors.New("either creds.Organization (deprecated) or creds.Domain must be set, but not both. To remedy this, re-add your credentials with `aws-okta add`")
}

// url parse & set base
Expand Down Expand Up @@ -526,9 +526,9 @@ func (p *OktaProvider) Retrieve() (sts.Credentials, string, error) {
}

newCookieItem := keyring.Item{
Key: p.OktaSessionCookieKey,
Data: []byte(newSessionCookie),
Label: "okta session cookie",
Key: p.OktaSessionCookieKey,
Data: []byte(newSessionCookie),
Label: "okta session cookie",
KeychainNotTrustApplication: false,
}

Expand Down
12 changes: 6 additions & 6 deletions lib/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,19 @@ func (p *Provider) Retrieve() (credentials.Value, error) {
func (p *Provider) getSamlURL() (string, error) {
oktaAwsSAMLUrl, profile, err := p.profiles.GetValue(p.profile, "aws_saml_url")
if err != nil {
log.Debugf("Using aws_saml_url from profile: %s", profile)
return oktaAwsSAMLUrl, nil
return "", errors.New("aws_saml_url missing from ~/.aws/config")
}
return "", errors.New("aws_saml_url missing from ~/.aws/config")
log.Debugf("Using aws_saml_url from profile: %s", profile)
return oktaAwsSAMLUrl, nil
}

func (p *Provider) getOktaSessionCookieKey() string {
oktaSessionCookieKey, profile, err := p.profiles.GetValue(p.profile, "okta_session_cookie_key")
if err != nil {
log.Debugf("Using okta_session_cookie_key from profile: %s", profile)
return oktaSessionCookieKey
return "okta-session-cookie"
}
return "okta-session-cookie"
log.Debugf("Using okta_session_cookie_key from profile: %s", profile)
return oktaSessionCookieKey
}

func (p *Provider) getSamlSessionCreds() (sts.Credentials, error) {
Expand Down

0 comments on commit 959c738

Please sign in to comment.