From a243b3830fcc83f9a5bd137bc508337f9e967d5d Mon Sep 17 00:00:00 2001 From: Shavin Chandrawansha Date: Thu, 9 Jul 2026 11:53:52 +0530 Subject: [PATCH 1/2] Fix connector configuration disappearing issue when key manager type switch back from Token Exchange In the Admin Portal, switching the Key Manager type back from Token Exchange causes the connector configuration section to disappear because setEnableDirectToken is never reset to true. This PR fixes the issue by restoring it to true during the type switch. Fixes: 4852 --- .../src/app/components/KeyManagers/AddEditKeyManager.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx b/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx index 2fe38c1d978..2a65bf3a615 100644 --- a/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx +++ b/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx @@ -284,10 +284,13 @@ function AddEditKeyManager(props) { console.error('Error when fetching organizations: ' + error); }); }; - const updateKeyManagerConnectorConfiguration = (keyManagerType) => { + const updateKeyManagerConnectorConfiguration = (keyManagerType, shouldResetTokenMode = false) => { if (keyManagerType === 'tokenExchange') { setEnableDirectToken(false); setEnableExchangeToken(true); + } else if (shouldResetTokenMode) { + setEnableDirectToken(true); + setEnableExchangeToken(false); } if (settings.keyManagerConfiguration) { settings.keyManagerConfiguration.map(({ @@ -462,7 +465,7 @@ function AddEditKeyManager(props) { } } else { if (e.target.name === 'type') { - updateKeyManagerConnectorConfiguration(e.target.value); + updateKeyManagerConnectorConfiguration(e.target.value, true); } if (e.target.name === 'enableSelfValidationJWT') { dispatch({ field: e.target.name, value: e.target.value === 'selfValidate' }); From 6b27ca992cae72867ef68d003676b3c3cd7923cd Mon Sep 17 00:00:00 2001 From: Shavin Chandrawansha Date: Thu, 9 Jul 2026 13:45:23 +0530 Subject: [PATCH 2/2] Fix reset on every type change to only from Token Exchange type When invoking updateKeyManagerConnectorConfiguration, change the hardcoded true value to dynamic so that only when the Key Manager type changes from Token Exchange to an another value, setEnableDirectToken will be restored to true. Fixes: #4852 --- .../source/src/app/components/KeyManagers/AddEditKeyManager.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx b/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx index 2a65bf3a615..998da8674fa 100644 --- a/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx +++ b/portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx @@ -465,7 +465,7 @@ function AddEditKeyManager(props) { } } else { if (e.target.name === 'type') { - updateKeyManagerConnectorConfiguration(e.target.value, true); + updateKeyManagerConnectorConfiguration(e.target.value, type === 'tokenExchange'); } if (e.target.name === 'enableSelfValidationJWT') { dispatch({ field: e.target.name, value: e.target.value === 'selfValidate' });