Skip to content

Commit

Permalink
fix(core): Look for iam_apikey in credential file with IAM auth
Browse files Browse the repository at this point in the history
  • Loading branch information
lpatino10 committed Apr 9, 2019
1 parent 9f653e0 commit 689d748
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/SupportingFiles/Shared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ internal struct Shared {
static let username = "username"
static let password = "password"
static let apiKey = "apikey"
static let iamApiKey = "iam_apikey"
static let iamURL = "iam_url"
static let icpPrefix = "icp-"
}
Expand Down Expand Up @@ -85,7 +86,7 @@ internal struct Shared {
/// Get the auth method based on the provided credentials
static func getAuthMethod(from credentials: [String: String]) -> AuthenticationMethod? {
// Get the appropriate auth method for the provided credentials
if let apiKey = credentials[Constant.apiKey] {
if let apiKey = (credentials[Constant.apiKey] ?? credentials[Constant.iamApiKey]) {
let iamURL = credentials[Constant.iamURL]
return getAuthMethod(apiKey: apiKey, iamURL: iamURL)
} else if let username = credentials[Constant.username],
Expand Down

0 comments on commit 689d748

Please sign in to comment.