From 3a9712651b1e38723d8e0cd166e3307175a3d5cf Mon Sep 17 00:00:00 2001 From: Thomas Pelletier Date: Tue, 29 Oct 2019 12:26:40 -0400 Subject: [PATCH] Helpful error when okta credentials not in keyring (#238) --- lib/okta.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/okta.go b/lib/okta.go index ddc7388d..96653a47 100644 --- a/lib/okta.go +++ b/lib/okta.go @@ -598,6 +598,9 @@ type OktaProvider struct { func (p *OktaProvider) Retrieve() (sts.Credentials, string, error) { log.Debugf("Using okta provider (%s)", p.OktaAccountName) item, err := p.Keyring.Get(p.OktaAccountName) + if err == keyring.ErrKeyNotFound { + return sts.Credentials{}, "", errors.New("Okta credentials are not in your keyring. Please make sure you have added okta credentials with `aws-okta add`") + } if err != nil { log.Debugf("Couldnt get okta creds from keyring: %s", err) return sts.Credentials{}, "", err