Fix[Admin]: Connector Configuration disappearing issue when Key Manager type switch from Token Exchange type#1388
Conversation
…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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAddEditKeyManager.jsx now resets token mode state when the key manager type changes, while preserving the existing tokenExchange handling. ChangesKey Manager token mode reset
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx`:
- Around line 287-294: The reset logic in updateKeyManagerConnectorConfiguration
is too broad because the type field’s onChange always passes
shouldResetTokenMode as true, so changing between non-tokenExchange types clears
enableExchangeToken unnecessarily. Update the type onChange flow in
AddEditKeyManager.jsx so the reset only happens when the previous key manager
type was tokenExchange, and keep the existing direct/exchange selections intact
for other type-to-type changes. Use the existing
updateKeyManagerConnectorConfiguration and the type onChange handler to gate the
reset based on the prior type state.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 38889b26-fcb7-414c-8038-359d7bf59222
📒 Files selected for processing (1)
portals/admin/src/main/webapp/source/src/app/components/KeyManagers/AddEditKeyManager.jsx
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
|



Purpose
When adding a new Key Manager from the APIM Admin Portal and switching the Key Manager type back from the
Token Exchangetype, theConnector Configurationsection disappears. This occurs because thesetEnableDirectTokenstate variable is never restored totrue.This PR fixes the issue by resetting the
setEnableDirectTokenvariable totruewhenever the Key Manager type switches away fromToken Exchange.Fixes #4852
Issue Link
File Modified:
AddEditKeyManager.jsx