parent
4d789f84e3
commit
4fc3865bbd
3 changed files with 20 additions and 2 deletions
|
@ -40,9 +40,10 @@ export const UserFederationSection = () => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
useFetch(
|
useFetch(
|
||||||
() => {
|
async () => {
|
||||||
|
const realmModel = await adminClient.realms.findOne({ realm });
|
||||||
const testParams: { [name: string]: string | number } = {
|
const testParams: { [name: string]: string | number } = {
|
||||||
parentId: realm,
|
parentId: realmModel.id!,
|
||||||
type: "org.keycloak.storage.UserStorageProvider",
|
type: "org.keycloak.storage.UserStorageProvider",
|
||||||
};
|
};
|
||||||
return adminClient.components.find(testParams);
|
return adminClient.components.find(testParams);
|
||||||
|
|
|
@ -16,6 +16,7 @@ import { useRealm } from "../../context/realm-context/RealmContext";
|
||||||
import { HelpItem } from "../../components/help-enabler/HelpItem";
|
import { HelpItem } from "../../components/help-enabler/HelpItem";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader";
|
import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader";
|
||||||
|
import { useAdminClient, useFetch } from "../../context/auth/AdminClient";
|
||||||
|
|
||||||
export type KerberosSettingsRequiredProps = {
|
export type KerberosSettingsRequiredProps = {
|
||||||
form: UseFormMethods;
|
form: UseFormMethods;
|
||||||
|
@ -30,6 +31,8 @@ export const KerberosSettingsRequired = ({
|
||||||
}: KerberosSettingsRequiredProps) => {
|
}: KerberosSettingsRequiredProps) => {
|
||||||
const { t } = useTranslation("user-federation");
|
const { t } = useTranslation("user-federation");
|
||||||
const helpText = useTranslation("user-federation-help").t;
|
const helpText = useTranslation("user-federation-help").t;
|
||||||
|
|
||||||
|
const adminClient = useAdminClient();
|
||||||
const { realm } = useRealm();
|
const { realm } = useRealm();
|
||||||
|
|
||||||
const [isEditModeDropdownOpen, setIsEditModeDropdownOpen] = useState(false);
|
const [isEditModeDropdownOpen, setIsEditModeDropdownOpen] = useState(false);
|
||||||
|
@ -39,6 +42,12 @@ export const KerberosSettingsRequired = ({
|
||||||
name: "config.allowPasswordAuthentication",
|
name: "config.allowPasswordAuthentication",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
useFetch(
|
||||||
|
() => adminClient.realms.findOne({ realm }),
|
||||||
|
(result) => form.setValue("parentId", result.id),
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{showSectionHeading && (
|
{showSectionHeading && (
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { FormAccess } from "../../components/form-access/FormAccess";
|
||||||
import { useRealm } from "../../context/realm-context/RealmContext";
|
import { useRealm } from "../../context/realm-context/RealmContext";
|
||||||
|
|
||||||
import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader";
|
import { WizardSectionHeader } from "../../components/wizard-section-header/WizardSectionHeader";
|
||||||
|
import { useAdminClient, useFetch } from "../../context/auth/AdminClient";
|
||||||
|
|
||||||
export type LdapSettingsGeneralProps = {
|
export type LdapSettingsGeneralProps = {
|
||||||
form: UseFormMethods;
|
form: UseFormMethods;
|
||||||
|
@ -27,8 +28,15 @@ export const LdapSettingsGeneral = ({
|
||||||
}: LdapSettingsGeneralProps) => {
|
}: LdapSettingsGeneralProps) => {
|
||||||
const { t } = useTranslation("user-federation");
|
const { t } = useTranslation("user-federation");
|
||||||
const helpText = useTranslation("user-federation-help").t;
|
const helpText = useTranslation("user-federation-help").t;
|
||||||
|
|
||||||
|
const adminClient = useAdminClient();
|
||||||
const { realm } = useRealm();
|
const { realm } = useRealm();
|
||||||
|
|
||||||
|
useFetch(
|
||||||
|
() => adminClient.realms.findOne({ realm }),
|
||||||
|
(result) => form.setValue("parentId", result.id),
|
||||||
|
[]
|
||||||
|
);
|
||||||
const [isVendorDropdownOpen, setIsVendorDropdownOpen] = useState(false);
|
const [isVendorDropdownOpen, setIsVendorDropdownOpen] = useState(false);
|
||||||
|
|
||||||
const setVendorDefaultValues = () => {
|
const setVendorDefaultValues = () => {
|
||||||
|
|
Loading…
Reference in a new issue