From 9291f3fb5391c30dffefa15f5475b12e19ce8811 Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Wed, 13 Jul 2022 15:13:47 -0400 Subject: [PATCH] Fix login and logout settings for SAML (#2947) --- src/clients/ClientSettings.tsx | 2 +- src/clients/add/LogoutPanel.tsx | 176 +++++++++++++++++--------------- 2 files changed, 92 insertions(+), 86 deletions(-) diff --git a/src/clients/ClientSettings.tsx b/src/clients/ClientSettings.tsx index 1821130af2..f83d0fdc8b 100644 --- a/src/clients/ClientSettings.tsx +++ b/src/clients/ClientSettings.tsx @@ -63,7 +63,7 @@ export const ClientSettings = (props: ClientSettingsProps) => { }, { title: t("loginSettings"), - isHidden: protocol !== "openid-connect" || client.bearerOnly, + isHidden: client.bearerOnly, panel: , }, { diff --git a/src/clients/add/LogoutPanel.tsx b/src/clients/add/LogoutPanel.tsx index 323f422240..8113a59971 100644 --- a/src/clients/add/LogoutPanel.tsx +++ b/src/clients/add/LogoutPanel.tsx @@ -35,7 +35,7 @@ export const LogoutPanel = ({ isHorizontal fineGrainedAccess={access?.configure} role="manage-clients" - className="pf-u-pb-xl" + className="pf-u-pb-4xl" > )} - - } - helperTextInvalid={errors.attributes?.backchannel?.logout?.url?.message} - validated={ - errors.attributes?.backchannel?.logout?.url?.message - ? ValidatedOptions.error - : ValidatedOptions.default - } - > - - ((uri.startsWith("https://") || uri.startsWith("http://")) && - !uri.includes("*")) || - uri === "" || - t("backchannelUrlInvalid").toString(), - })} - validated={ - errors.attributes?.backchannel?.logout?.url?.message - ? ValidatedOptions.error - : ValidatedOptions.default - } - /> - - - } - fieldId="backchannelLogoutSessionRequired" - hasNoPaddingTop - > - ( - onChange(value.toString())} + {protocol === "openid-connect" && ( + <> + + } + helperTextInvalid={ + errors.attributes?.backchannel?.logout?.url?.message + } + validated={ + errors.attributes?.backchannel?.logout?.url?.message + ? ValidatedOptions.error + : ValidatedOptions.default + } + > + + ((uri.startsWith("https://") || uri.startsWith("http://")) && + !uri.includes("*")) || + uri === "" || + t("backchannelUrlInvalid").toString(), + })} + validated={ + errors.attributes?.backchannel?.logout?.url?.message + ? ValidatedOptions.error + : ValidatedOptions.default + } /> - )} - /> - - - } - fieldId="backchannelLogoutRevokeOfflineSessions" - hasNoPaddingTop - > - ( - onChange(value.toString())} + + + } + fieldId="backchannelLogoutSessionRequired" + hasNoPaddingTop + > + ( + onChange(value.toString())} + /> + )} /> - )} - /> - + + + } + fieldId="backchannelLogoutRevokeOfflineSessions" + hasNoPaddingTop + > + ( + onChange(value.toString())} + /> + )} + /> + + + )}