From 75e0bf74355156d38d6188f8feb489ef7dc45f99 Mon Sep 17 00:00:00 2001 From: mfrances Date: Fri, 12 Mar 2021 17:31:45 -0500 Subject: [PATCH] add missing kerberos fields --- .../ldap/LdapSettingsKerberosIntegration.tsx | 147 +++++++++++++++++- 1 file changed, 145 insertions(+), 2 deletions(-) diff --git a/src/user-federation/ldap/LdapSettingsKerberosIntegration.tsx b/src/user-federation/ldap/LdapSettingsKerberosIntegration.tsx index 42c16347f7..547d0467ac 100644 --- a/src/user-federation/ldap/LdapSettingsKerberosIntegration.tsx +++ b/src/user-federation/ldap/LdapSettingsKerberosIntegration.tsx @@ -1,8 +1,8 @@ -import { FormGroup, Switch } from "@patternfly/react-core"; +import { FormGroup, Switch, TextInput } from "@patternfly/react-core"; import { useTranslation } from "react-i18next"; import React from "react"; import { HelpItem } from "../../components/help-enabler/HelpItem"; -import { UseFormMethods, Controller } from "react-hook-form"; +import { UseFormMethods, Controller, useWatch } from "react-hook-form"; import { FormAccess } from "../../components/form-access/FormAccess"; import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader"; @@ -20,6 +20,12 @@ export const LdapSettingsKerberosIntegration = ({ const { t } = useTranslation("user-federation"); const helpText = useTranslation("user-federation-help").t; + const allowKerberosAuth: [string] = useWatch({ + control: form.control, + name: "config.allowKerberosAuthentication", + defaultValue: ["true"], + }); + return ( <> {showSectionHeading && ( @@ -59,6 +65,143 @@ export const LdapSettingsKerberosIntegration = ({ )} > + + {allowKerberosAuth[0] === "true" && ( + <> + + } + fieldId="kc-kerberos-realm" + isRequired + > + + {form.errors.config && + form.errors.config.kerberosRealm && + form.errors.config.kerberosRealm[0] && ( +
+ {form.errors.config.kerberosRealm[0].message} +
+ )} +
+ + + } + fieldId="kc-server-principal" + isRequired + > + + {form.errors.config && + form.errors.config.serverPrincipal && + form.errors.config.serverPrincipal[0] && ( +
+ {form.errors.config.serverPrincipal[0].message} +
+ )} +
+ + + } + fieldId="kc-key-tab" + isRequired + > + + {form.errors.config && + form.errors.config.keyTab && + form.errors.config.keyTab[0] && ( +
+ {form.errors.config.keyTab[0].message} +
+ )} +
+ + )} + + + } + fieldId="kc-debug" + hasNoPaddingTop + > + {" "} + ( + onChange([`${value}`])} + isChecked={value[0] === "true"} + label={t("common:on")} + labelOff={t("common:off")} + /> + )} + > + +