From 5100627c7f8bc986049a2c239be81863dc490c8a Mon Sep 17 00:00:00 2001 From: Marc Barlo Date: Wed, 23 Jan 2019 16:47:28 -0800 Subject: [PATCH] Fix error handling on getSamlURL and getoktaSessionCookieKey --- lib/provider.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/provider.go b/lib/provider.go index 7ea98c56..e5dc8a69 100644 --- a/lib/provider.go +++ b/lib/provider.go @@ -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) {