Skip to content

Commit

Permalink
provide apikey high precednece than tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
hkantare authored and sakshiag committed Sep 27, 2019
1 parent 4865325 commit 53685ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ibm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func (c *Config) ClientSession() (interface{}, error) {
return session, nil
}

if sess.BluemixSession.Config.BluemixAPIKey != "" && (sess.BluemixSession.Config.IAMAccessToken == "" && sess.BluemixSession.Config.IAMRefreshToken == "") {
if sess.BluemixSession.Config.BluemixAPIKey != "" {
err = authenticateAPIKey(sess.BluemixSession)
if err != nil {
session.bmxUserFetchErr = fmt.Errorf("Error occured while fetching account user details: %q", err)
Expand All @@ -332,7 +332,7 @@ func (c *Config) ClientSession() (interface{}, error) {
}
}

if sess.BluemixSession.Config.IAMAccessToken != "" {
if sess.BluemixSession.Config.IAMAccessToken != "" && sess.BluemixSession.Config.BluemixAPIKey == "" {
err := refreshToken(sess.BluemixSession)
if err != nil {
return nil, err
Expand Down

0 comments on commit 53685ad

Please sign in to comment.