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")} + /> + )} + > + +