2020-11-25 16:17:50 +00:00
|
|
|
import { FormGroup, Switch } from "@patternfly/react-core";
|
2020-10-30 20:15:37 +00:00
|
|
|
import { useTranslation } from "react-i18next";
|
|
|
|
import React from "react";
|
|
|
|
import { HelpItem } from "../components/help-enabler/HelpItem";
|
2020-11-25 14:50:40 +00:00
|
|
|
import { useForm, Controller } from "react-hook-form";
|
|
|
|
import ComponentRepresentation from "keycloak-admin/lib/defs/componentRepresentation";
|
2020-11-25 16:17:50 +00:00
|
|
|
import { FormAccess } from "../components/form-access/FormAccess";
|
2020-10-30 20:15:37 +00:00
|
|
|
|
|
|
|
export const LdapSettingsKerberosIntegration = () => {
|
|
|
|
const { t } = useTranslation("user-federation");
|
|
|
|
const helpText = useTranslation("user-federation-help").t;
|
|
|
|
|
2020-11-25 16:17:50 +00:00
|
|
|
const { control } = useForm<ComponentRepresentation>();
|
2020-11-25 14:50:40 +00:00
|
|
|
|
2020-10-30 20:15:37 +00:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
{/* Kerberos integration */}
|
2020-11-25 16:17:50 +00:00
|
|
|
<FormAccess role="manage-realm" isHorizontal>
|
2020-10-30 20:15:37 +00:00
|
|
|
<FormGroup
|
|
|
|
label={t("allowKerberosAuthentication")}
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem
|
|
|
|
helpText={helpText("allowKerberosAuthenticationHelp")}
|
|
|
|
forLabel={t("allowKerberosAuthentication")}
|
|
|
|
forID="kc-allow-kerberos-authentication"
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
fieldId="kc-allow-kerberos-authentication"
|
|
|
|
hasNoPaddingTop
|
|
|
|
>
|
2020-11-25 14:50:40 +00:00
|
|
|
<Controller
|
|
|
|
name="allowKerberosAuthentication"
|
|
|
|
defaultValue={false}
|
|
|
|
control={control}
|
|
|
|
render={({ onChange, value }) => (
|
|
|
|
<Switch
|
|
|
|
id={"kc-allow-kerberos-authentication"}
|
|
|
|
isDisabled={false}
|
|
|
|
onChange={onChange}
|
|
|
|
isChecked={value}
|
|
|
|
label={t("common:on")}
|
|
|
|
labelOff={t("common:off")}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
></Controller>
|
2020-10-30 20:15:37 +00:00
|
|
|
</FormGroup>
|
|
|
|
|
|
|
|
<FormGroup
|
|
|
|
label={t("useKerberosForPasswordAuthentication")}
|
|
|
|
labelIcon={
|
|
|
|
<HelpItem
|
|
|
|
helpText={helpText("useKerberosForPasswordAuthenticationHelp")}
|
|
|
|
forLabel={t("useKerberosForPasswordAuthentication")}
|
|
|
|
forID="kc-use-kerberos-password-authentication"
|
|
|
|
/>
|
|
|
|
}
|
|
|
|
fieldId="kc-use-kerberos-password-authentication"
|
|
|
|
hasNoPaddingTop
|
|
|
|
>
|
2020-11-25 14:50:40 +00:00
|
|
|
<Controller
|
|
|
|
name="useKerberosForPasswordAuthentication"
|
|
|
|
defaultValue={false}
|
|
|
|
control={control}
|
|
|
|
render={({ onChange, value }) => (
|
|
|
|
<Switch
|
|
|
|
id={"kc-use-kerberos-password-authentication"}
|
|
|
|
isDisabled={false}
|
|
|
|
onChange={onChange}
|
|
|
|
isChecked={value}
|
|
|
|
label={t("common:on")}
|
|
|
|
labelOff={t("common:off")}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
></Controller>
|
2020-10-30 20:15:37 +00:00
|
|
|
</FormGroup>
|
2020-11-25 16:17:50 +00:00
|
|
|
</FormAccess>
|
2020-10-30 20:15:37 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|