Skip to content

simplify ECA enablement check #1584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2025
Merged
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
13 changes: 7 additions & 6 deletions src/main/java/com/salesforce/dataloader/config/AppConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -2045,8 +2045,7 @@ public int getMaxBytesInBulkBatch() {
* @return true if ECA is configured with client ID and secret
*/
public boolean isExternalClientAppConfigured() {
return getBoolean(PROP_USE_EXTERNAL_CLIENT_APP) &&
!isEmpty(getECAClientIdForCurrentEnv()) &&
return !isEmpty(getECAClientIdForCurrentEnv()) &&
!isEmpty(getECAClientSecretForCurrentEnv());
}

Expand Down Expand Up @@ -2103,13 +2102,15 @@ public String getEffectiveClientSecretForCurrentEnv() {
* @return validation message or null if valid
*/
public String validateExternalClientAppConfig() {
if (!getBoolean(PROP_USE_EXTERNAL_CLIENT_APP)) {
return null; // Not using ECA, no validation needed
}

String clientId = getECAClientIdForCurrentEnv();
String clientSecret = getECAClientSecretForCurrentEnv();

// If neither ECA client ID nor secret is configured, no validation needed (using Connected App)
if (isEmpty(clientId) && isEmpty(clientSecret)) {
return null;
}

// If only one of the two is configured, that's an error
if (isEmpty(clientId)) {
return Messages.getMessage(AppConfig.class, "ecaClientIdRequired");
}
Expand Down
Loading