Skip to content

Commit

Permalink
adding additional debug/error information
Browse files Browse the repository at this point in the history
  • Loading branch information
dkujawski committed Jan 31, 2020
1 parent 2438989 commit bf3f799
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/okta.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func (o *OktaClient) AuthenticateProfile3(profileARN string, duration time.Durat
}

// retrieve IAM Roles
log.Debug("Step: 3.1")
principal, role, err := GetRoleFromSAML(assertion.Resp, profileARN)
if err != nil {
return sts.Credentials{}, oc, err
Expand Down
3 changes: 2 additions & 1 deletion lib/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func GetRoleFromSAML(resp *saml.Response, profileARN string) (string, string, er
if err != nil {
return "", "", err
}
log.Debugf("Found roles from SAML: %#v", roles)
role, err := GetRole(roles, profileARN)
if err != nil {
return "", "", err
Expand Down Expand Up @@ -91,7 +92,7 @@ func GetRole(roleList saml.AssumableRoles, profileARN string) (saml.AssumableRol
return arole, nil
}
}
return saml.AssumableRole{}, fmt.Errorf("ARN isn't valid")
return saml.AssumableRole{}, fmt.Errorf("ARN isn't valid %s", profileARN)
}

// if the user only has one role assume that role without prompting.
Expand Down

0 comments on commit bf3f799

Please sign in to comment.