From 37afe07bd5950eef64e985ca32f1711654a7a6f9 Mon Sep 17 00:00:00 2001 From: Erik Jan de Wit Date: Tue, 25 Oct 2022 19:52:17 +0200 Subject: [PATCH] Keep existing config we don't have fields for (#3639) --- .../src/identity-providers/add/DetailSettings.tsx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx b/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx index 8cd8c0b5eb..a72683ec1c 100644 --- a/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx +++ b/apps/admin-ui/src/identity-providers/add/DetailSettings.tsx @@ -162,8 +162,8 @@ export default function DetailSettings() { [] ); - const save = async (provider?: IdentityProviderRepresentation) => { - const p = provider || getValues(); + const save = async (savedProvider?: IdentityProviderRepresentation) => { + const p = savedProvider || getValues(); if (p.config?.authnContextClassRefs) p.config.authnContextClassRefs = JSON.stringify( p.config.authnContextClassRefs @@ -172,10 +172,16 @@ export default function DetailSettings() { p.config.authnContextDeclRefs = JSON.stringify( p.config.authnContextDeclRefs ); + try { await adminClient.identityProviders.update( { alias }, - { ...p, alias, providerId } + { + ...p, + config: { ...provider?.config, ...p.config }, + alias, + providerId, + } ); addAlert(t("updateSuccess"), AlertVariant.success); } catch (error) {