Skip to content

PKCE port in Settings dialog #1575

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 8, 2025
Merged
Show file tree
Hide file tree
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 @@ -1802,7 +1802,7 @@ private synchronized static String getDefaultCharsetForCsvReadWrite() {

private final List<ConfigListener> listeners = new ArrayList<ConfigListener>();
public static final int DEFAULT_MAX_SOQL_CHAR_LENGTH = 100000;
public static final int DEFAULT_OAUTH_PKCE_PORT = 1717;
public static final int DEFAULT_OAUTH_PKCE_PORT = 7171;

public synchronized void addListener(ConfigListener l) {
listeners.add(l);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public class AdvancedSettingsDialog extends BaseDialog {
private Text textSandboxBulkClientID;
private Text textWizardWidth;
private Text textWizardHeight;
private Text textOAuthPKCEPort;

private Button buttonShowWelcomeScreen;
private Button buttonShowLoaderUpgradeScreen;
Expand Down Expand Up @@ -795,6 +796,22 @@ public void verifyText(VerifyEvent event) {
buttonLoginFromBrowser = new Button(restComp, SWT.CHECK);
buttonLoginFromBrowser.setSelection(doLoginFromBrowser);

// OAuth PKCE Port
createLabel(restComp, null, null, AppConfig.PROP_OAUTH_PKCE_PORT);
textOAuthPKCEPort = new Text(restComp, SWT.BORDER);
textOAuthPKCEPort.setText(appConfig.getString(AppConfig.PROP_OAUTH_PKCE_PORT));
textOAuthPKCEPort.addVerifyListener(new VerifyListener() {
@Override
public void verifyText(VerifyEvent event) {
event.doit = Character.isISOControl(event.character) || Character.isDigit(event.character);
}
});
data = new GridData();
textOAuthPKCEPort.setTextLimit(5);
data.widthHint = 5 * textSize.x;
textOAuthPKCEPort.setLayoutData(data);
textOAuthPKCEPort.setToolTipText(Labels.getString("AdvancedSettingsDialog.uiTooltip." + AppConfig.PROP_OAUTH_PKCE_PORT));

createLabel(restComp, null, null,
appConfig.getOAuthEnvironmentPropertyName(AppConfig.SERVER_PROD_ENVIRONMENT_VAL, AppConfig.PARTNER_CLIENTID_LITERAL));
this.textProductionPartnerClientID = new Text(restComp, SWT.NONE);
Expand Down Expand Up @@ -1066,6 +1083,7 @@ public void widgetSelected(SelectionEvent event) {
appConfig.setValue(AppConfig.PROP_BULK_API_ZIP_CONTENT, buttonBulkApiZipContent.getSelection());
appConfig.setValue(AppConfig.PROP_BULKV2_API_ENABLED, buttonUseBulkV2Api.getSelection());
appConfig.setValue(AppConfig.PROP_OAUTH_LOGIN_FROM_BROWSER, buttonLoginFromBrowser.getSelection());
appConfig.setValue(AppConfig.PROP_OAUTH_PKCE_PORT, textOAuthPKCEPort.getText());
appConfig.setValue(AppConfig.PROP_WIZARD_CLOSE_ON_FINISH, buttonCloseWizardOnFinish.getSelection());
appConfig.setValue(AppConfig.PROP_WIZARD_WIDTH, textWizardWidth.getText());
appConfig.setValue(AppConfig.PROP_WIZARD_HEIGHT, textWizardHeight.getText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,6 @@ private void logErrorResponse(InputStream inputStream) {
* Finds an available port for the callback server.
*/
private int findAvailablePort() {
// First try the configured port (defaults to 1717, same as Salesforce CLI)
int preferredPort;
try {
preferredPort = appConfig.getInt(AppConfig.PROP_OAUTH_PKCE_PORT);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/labels.properties
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ AdvancedSettingsDialog.uiLabel.loader.query.delimiter=Delimiter for query result
AdvancedSettingsDialog.uiLabel.loader.query.includeBinaryData=Include image content in query results of Rich Text Fields:
AdvancedSettingsDialog.uiLabel.escapeFormulaInFieldValue=Escape formula values in exported results with a single-quote character:
AdvancedSettingsDialog.uiLabel.sfdc.oauth.loginfrombrowser=Enable OAuth login from browser:
AdvancedSettingsDialog.uiLabel.sfdc.oauth.pkce.port=OAuth PKCE callback port:
AdvancedSettingsDialog.uiTooltip.sfdc.oauth.pkce.port=Port number for local HTTP server used during OAuth PKCE authentication (defaults to 7171)
AdvancedSettingsDialog.uiLabel.sfdc.oauth.Production.partner.clientid=Client ID for SOAP API in Production:
AdvancedSettingsDialog.uiLabel.sfdc.oauth.Production.bulk.clientid=Client ID for Bulk API and Bulk API 2.0 in Production:
AdvancedSettingsDialog.uiLabel.sfdc.oauth.Sandbox.partner.clientid=Client ID for SOAP API in Sandbox:
Expand Down
Loading