Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ private void saveCredentials(ClientApplication app, ClientApplication actualApp)
if (opt.isPresent()) {
LOG.info("Found extclients credential with same ID");
//I found a credential with same id name but different in some properties, I have to update it
endpoint.append("/" + cred.getId());
ClientAppCredential target = opt.get();
endpoint.append("/" + target.getId());
update = true;
copyClientAppCredential(cred, opt.get(), false);
copyClientAppCredential(cred, target, false);
}
} else if (cred instanceof APIKey) {
final String credentialId = ((APIKey) cred).getApiKey();
Expand Down Expand Up @@ -504,15 +505,14 @@ protected Optional<ClientAppCredential> searchForExistingCredential(ClientApplic
if (o instanceof OAuth)
return ((OAuth) o).getClientId().equals(credentialId);
if (o instanceof ExtClients)
return o.getId().equals(credentialId);
return ((ExtClients) o).getClientId().equals(credentialId);
if (o instanceof APIKey)
return o.getId().equals(credentialId);
return false;
}).findFirst();
} else {
return Optional.empty();
}

}

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