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

Commit

Permalink
Fix error handling on getSamlURL and getoktaSessionCookieKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Fauzyy committed Jan 24, 2019
1 parent a0b71df commit 5100627
Showing 1 changed file with 6 additions and 6 deletions.
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 5100627

Please sign in to comment.