Skip to content

Commit 3a8e06e

Browse files
authored
Merge pull request #570 from matthewboss-axway/develop
Fix issue with updating of external credentials
2 parents 32f7a68 + 3c852d7 commit 3a8e06e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/apim-adapter/src/main/java/com/axway/apim/adapter/client/apps/APIMgrAppsAdapter.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,10 @@ private void saveCredentials(ClientApplication app, ClientApplication actualApp)
443443
if (opt.isPresent()) {
444444
LOG.info("Found extclients credential with same ID");
445445
//I found a credential with same id name but different in some properties, I have to update it
446-
endpoint.append("/" + cred.getId());
446+
ClientAppCredential target = opt.get();
447+
endpoint.append("/" + target.getId());
447448
update = true;
448-
copyClientAppCredential(cred, opt.get(), false);
449+
copyClientAppCredential(cred, target, false);
449450
}
450451
} else if (cred instanceof APIKey) {
451452
final String credentialId = ((APIKey) cred).getApiKey();
@@ -504,15 +505,14 @@ protected Optional<ClientAppCredential> searchForExistingCredential(ClientApplic
504505
if (o instanceof OAuth)
505506
return ((OAuth) o).getClientId().equals(credentialId);
506507
if (o instanceof ExtClients)
507-
return o.getId().equals(credentialId);
508+
return ((ExtClients) o).getClientId().equals(credentialId);
508509
if (o instanceof APIKey)
509510
return o.getId().equals(credentialId);
510511
return false;
511512
}).findFirst();
512513
} else {
513514
return Optional.empty();
514515
}
515-
516516
}
517517

518518
public RestAPICall createUpsertUri(HttpEntity entity, URI uri, ClientApplication actualApp) {

0 commit comments

Comments
 (0)