diff --git a/frontend/src/hooks/api/ldapConfig/queries.tsx b/frontend/src/hooks/api/ldapConfig/queries.tsx
index c84f90aacf..e92a7a1c76 100644
--- a/frontend/src/hooks/api/ldapConfig/queries.tsx
+++ b/frontend/src/hooks/api/ldapConfig/queries.tsx
@@ -13,9 +13,15 @@ export const useGetLDAPConfig = (organizationId: string) => {
return useQuery({
queryKey: ldapConfigKeys.getLDAPConfig(organizationId),
queryFn: async () => {
- const { data } = await apiRequest.get(`/api/v1/ldap/config?organizationId=${organizationId}`);
+ try {
+ const { data } = await apiRequest.get(
+ `/api/v1/ldap/config?organizationId=${organizationId}`
+ );
- return data;
+ return data;
+ } catch (err) {
+ return null;
+ }
},
enabled: true
});
diff --git a/frontend/src/hooks/api/oidcConfig/queries.tsx b/frontend/src/hooks/api/oidcConfig/queries.tsx
index 08b38cbb88..49db7c5d46 100644
--- a/frontend/src/hooks/api/oidcConfig/queries.tsx
+++ b/frontend/src/hooks/api/oidcConfig/queries.tsx
@@ -12,11 +12,15 @@ export const useGetOIDCConfig = (orgSlug: string) => {
return useQuery({
queryKey: oidcConfigKeys.getOIDCConfig(orgSlug),
queryFn: async () => {
- const { data } = await apiRequest.get(
- `/api/v1/sso/oidc/config?orgSlug=${orgSlug}`
- );
+ try {
+ const { data } = await apiRequest.get(
+ `/api/v1/sso/oidc/config?orgSlug=${orgSlug}`
+ );
- return data;
+ return data;
+ } catch (err) {
+ return null;
+ }
},
enabled: true
});
diff --git a/frontend/src/hooks/api/ssoConfig/queries.tsx b/frontend/src/hooks/api/ssoConfig/queries.tsx
index 3074c5edaa..cbb8e0abe1 100644
--- a/frontend/src/hooks/api/ssoConfig/queries.tsx
+++ b/frontend/src/hooks/api/ssoConfig/queries.tsx
@@ -11,9 +11,15 @@ export const useGetSSOConfig = (organizationId: string) => {
return useQuery({
queryKey: ssoConfigKeys.getSSOConfig(organizationId),
queryFn: async () => {
- const { data } = await apiRequest.get(`/api/v1/sso/config?organizationId=${organizationId}`);
+ try {
+ const { data } = await apiRequest.get(
+ `/api/v1/sso/config?organizationId=${organizationId}`
+ );
- return data;
+ return data;
+ } catch (err) {
+ return null;
+ }
},
enabled: true
});
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/LDAPModal.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/LDAPModal.tsx
index e8afe9822f..865be26e92 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/LDAPModal.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/LDAPModal.tsx
@@ -4,8 +4,17 @@ import { zodResolver } from "@hookform/resolvers/zod";
import { z } from "zod";
import { createNotification } from "@app/components/notifications";
-import { Button, FormControl, Input, Modal, ModalContent, TextArea } from "@app/components/v2";
+import {
+ Button,
+ DeleteActionModal,
+ FormControl,
+ Input,
+ Modal,
+ ModalContent,
+ TextArea
+} from "@app/components/v2";
import { useOrganization } from "@app/context";
+import { useToggle } from "@app/hooks";
import {
useCreateLDAPConfig,
useGetLDAPConfig,
@@ -32,9 +41,10 @@ type Props = {
popUp: UsePopUpState<["addLDAP"]>;
handlePopUpClose: (popUpName: keyof UsePopUpState<["addLDAP"]>) => void;
handlePopUpToggle: (popUpName: keyof UsePopUpState<["addLDAP"]>, state?: boolean) => void;
+ hideDelete?: boolean;
};
-export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
+export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateLDAPConfig();
@@ -46,6 +56,39 @@ export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
resolver: zodResolver(LDAPFormSchema)
});
+ const [isDeletePopupOpen, setIsDeletePopupOpen] = useToggle();
+
+ const handleLdapSoftDelete = async () => {
+ if (!currentOrg) {
+ return;
+ }
+ try {
+ await updateMutateAsync({
+ organizationId: currentOrg.id,
+ isActive: false,
+ url: "",
+ bindDN: "",
+ bindPass: "",
+ searchBase: "",
+ searchFilter: "",
+ uniqueUserAttribute: "",
+ groupSearchBase: "",
+ groupSearchFilter: "",
+ caCert: ""
+ });
+
+ createNotification({
+ text: "Successfully deleted OIDC configuration.",
+ type: "success"
+ });
+ } catch (err) {
+ createNotification({
+ text: "Failed deleting OIDC configuration.",
+ type: "error"
+ });
+ }
+ };
+
const watchUrl = watch("url");
const watchBindDN = watch("bindDN");
const watchBindPass = watch("bindPass");
@@ -175,138 +218,154 @@ export const LDAPModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
};
return (
- {
- handlePopUpToggle("addLDAP", isOpen);
- reset();
- }}
- >
-
-
-
-
+ <>
+ {
+ handlePopUpToggle("addLDAP", isOpen);
+ reset();
+ }}
+ >
+
+
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+
+
+
+ {!data ? "Add" : "Update"}
+
+
+ Test Connection
+
+
+ {!hideDelete && (
+
setIsDeletePopupOpen.on()}>
+ Delete
+
+ )}
+
+
+
+
+ setIsDeletePopupOpen.toggle()}
+ deleteKey="confirm"
+ onDeleteApproved={handleLdapSoftDelete}
+ />
+ >
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OIDCModal.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OIDCModal.tsx
index ba3b0b8af4..53aab635d0 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OIDCModal.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OIDCModal.tsx
@@ -6,6 +6,7 @@ import { z } from "zod";
import { createNotification } from "@app/components/notifications";
import {
Button,
+ DeleteActionModal,
FormControl,
Input,
Modal,
@@ -28,6 +29,7 @@ type Props = {
popUp: UsePopUpState<["addOIDC"]>;
handlePopUpClose: (popUpName: keyof UsePopUpState<["addOIDC"]>) => void;
handlePopUpToggle: (popUpName: keyof UsePopUpState<["addOIDC"]>, state?: boolean) => void;
+ hideDelete?: boolean;
};
const schema = z
@@ -94,11 +96,13 @@ const schema = z
export type OIDCFormData = z.infer;
-export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
+export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateOIDCConfig();
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateOIDCConfig();
+ const [isDeletePopupOpen, setIsDeletePopupOpen] = useToggle(false);
+
const { data } = useGetOIDCConfig(currentOrg?.slug ?? "");
const { control, handleSubmit, reset, setValue, watch } = useForm({
@@ -112,6 +116,36 @@ export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
const [isClientSecretFocused, setIsClientSecretFocused] = useToggle();
const configurationTypeValue = watch("configurationType");
+ const handleOidcSoftDelete = async () => {
+ if (!currentOrg) {
+ return;
+ }
+ try {
+ await updateMutateAsync({
+ issuer: "",
+ discoveryURL: "",
+ authorizationEndpoint: "",
+ allowedEmailDomains: "",
+ jwksUri: "",
+ tokenEndpoint: "",
+ userinfoEndpoint: "",
+ clientId: "",
+ clientSecret: "",
+ isActive: false,
+ orgSlug: currentOrg.slug
+ });
+
+ createNotification({
+ text: "Successfully deleted OIDC configuration.",
+ type: "success"
+ });
+ } catch (err) {
+ createNotification({
+ text: "Failed deleting OIDC configuration.",
+ type: "error"
+ });
+ }
+ };
useEffect(() => {
if (data) {
@@ -193,212 +227,232 @@ export const OIDCModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
};
return (
- {
- handlePopUpToggle("addOIDC", isOpen);
- reset();
- }}
- >
-
-
- (
-
- onChange(e)}
- >
- Discovery URL
- Custom
-
-
- )}
- />
- {configurationTypeValue === ConfigurationType.DISCOVERY_URL && (
+ <>
+ {
+ handlePopUpToggle("addOIDC", isOpen);
+ reset();
+ }}
+ >
+
+
(
+
+ onChange(e)}
+ >
+ Discovery URL
+ Custom
+
+
+ )}
+ />
+ {configurationTypeValue === ConfigurationType.DISCOVERY_URL && (
+ (
+
+
+
+ )}
+ />
+ )}
+ {configurationTypeValue === ConfigurationType.CUSTOM && (
+ <>
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ >
+ )}
+ (
+
+
+ )}
+ />
+ (
+
+ setIsClientIdFocused.on()}
+ {...field}
+ onBlur={() => {
+ field.onBlur();
+ setIsClientIdFocused.off();
+ }}
+ autoComplete="off"
+ className="bg-mineshaft-800"
+ />
+
+ )}
+ />
+ (
+
setIsClientSecretFocused.on()}
+ onBlur={() => {
+ field.onBlur();
+ setIsClientSecretFocused.off();
+ }}
+ className="bg-mineshaft-800"
/>
)}
/>
- )}
- {configurationTypeValue === ConfigurationType.CUSTOM && (
- <>
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- >
- )}
- (
-
-
-
- )}
- />
- (
-
- setIsClientIdFocused.on()}
- {...field}
- onBlur={() => {
- field.onBlur();
- setIsClientIdFocused.off();
- }}
- autoComplete="off"
- className="bg-mineshaft-800"
- />
-
- )}
- />
- (
-
- setIsClientSecretFocused.on()}
- onBlur={() => {
- field.onBlur();
- setIsClientSecretFocused.off();
- }}
- className="bg-mineshaft-800"
- />
-
- )}
- />
-
-
- {!data ? "Add" : "Update"}
-
- handlePopUpClose("addOIDC")}
- >
- Cancel
-
-
-
-
-
+
+
+
+ {!data ? "Add" : "Update"}
+
+ handlePopUpClose("addOIDC")}
+ >
+ Cancel
+
+
+ {!hideDelete && (
+
setIsDeletePopupOpen.on()}>
+ Delete
+
+ )}
+
+
+
+
+ setIsDeletePopupOpen.toggle()}
+ deleteKey="confirm"
+ onDeleteApproved={handleOidcSoftDelete}
+ />
+ >
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgAuthTab.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgAuthTab.tsx
index d344b8a28e..f4c4c0c5d8 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgAuthTab.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgAuthTab.tsx
@@ -1,34 +1,191 @@
-import { OrgPermissionActions, OrgPermissionSubjects, useServerConfig } from "@app/context";
+import { twMerge } from "tailwind-merge";
+
+import { Button, ContentLoader, UpgradePlanModal } from "@app/components/v2";
+import {
+ OrgPermissionActions,
+ OrgPermissionSubjects,
+ useOrganization,
+ useServerConfig,
+ useSubscription
+} from "@app/context";
import { withPermission } from "@app/hoc";
+import { usePopUp } from "@app/hooks";
+import { useGetLDAPConfig, useGetOIDCConfig, useGetSSOConfig } from "@app/hooks/api";
import { LoginMethod } from "@app/hooks/api/admin/types";
+import { LDAPModal } from "./LDAPModal";
+import { OIDCModal } from "./OIDCModal";
import { OrgGeneralAuthSection } from "./OrgGeneralAuthSection";
import { OrgLDAPSection } from "./OrgLDAPSection";
import { OrgOIDCSection } from "./OrgOIDCSection";
import { OrgScimSection } from "./OrgSCIMSection";
import { OrgSSOSection } from "./OrgSSOSection";
+import { SSOModal } from "./SSOModal";
export const OrgAuthTab = withPermission(
() => {
const {
config: { enabledLoginMethods }
} = useServerConfig();
+ const { currentOrg } = useOrganization();
+ const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([
+ "addLDAP",
+ "addSSO",
+ "addOIDC",
+ "upgradePlan"
+ ] as const);
+
+ const { subscription } = useSubscription();
+
+ const { data: oidcConfig, isLoading: isLoadingOidcConfig } = useGetOIDCConfig(
+ currentOrg?.slug ?? ""
+ );
+ const { data: samlConfig, isLoading: isLoadingSamlConfig } = useGetSSOConfig(
+ currentOrg?.id ?? ""
+ );
+ const { data: ldapConfig, isLoading: isLoadingLdapConfig } = useGetLDAPConfig(
+ currentOrg?.id ?? ""
+ );
+ const areConfigsLoading = isLoadingOidcConfig || isLoadingSamlConfig || isLoadingLdapConfig;
const shouldDisplaySection = (method: LoginMethod) =>
!enabledLoginMethods || enabledLoginMethods.includes(method);
+ const isOidcConfigured = oidcConfig && (oidcConfig.discoveryURL || oidcConfig.issuer);
+ const isSamlConfigured = samlConfig && samlConfig.entryPoint;
+ const isLdapConfigured = ldapConfig && ldapConfig.url;
+
+ const shouldShowCreateIdentityProviderView =
+ !isOidcConfigured && !isSamlConfigured && !isLdapConfigured;
+
+ const createIdentityProviderView = (shouldDisplaySection(LoginMethod.SAML) ||
+ shouldDisplaySection(LoginMethod.OIDC) ||
+ shouldDisplaySection(LoginMethod.LDAP)) && (
+ <>
+
+
Connect an Identity Provider
+
+ Connect your identity provider to simplify user management
+
+ {shouldDisplaySection(LoginMethod.SAML) && (
+
+
SAML
+
{
+ if (!subscription?.samlSSO) {
+ handlePopUpOpen("upgradePlan", { feature: "SAML SSO", plan: "Pro" });
+ return;
+ }
+
+ handlePopUpOpen("addSSO");
+ }}
+ >
+ Connect
+
+
+ )}
+ {shouldDisplaySection(LoginMethod.OIDC) && (
+
+
OIDC
+
{
+ if (!subscription?.oidcSSO) {
+ handlePopUpOpen("upgradePlan", { feature: "OIDC SSO", plan: "Pro" });
+ return;
+ }
+
+ handlePopUpOpen("addOIDC");
+ }}
+ >
+ Connect
+
+
+ )}
+ {shouldDisplaySection(LoginMethod.LDAP) && (
+
+
LDAP
+
{
+ if (!subscription?.ldap) {
+ handlePopUpOpen("upgradePlan", { feature: "LDAP", plan: "Enterprise" });
+ return;
+ }
+
+ handlePopUpOpen("addLDAP");
+ }}
+ >
+ Connect
+
+
+ )}
+
+
+
+
+ >
+ );
+
+ if (areConfigsLoading) {
+ return ;
+ }
+
return (
-
- {shouldDisplaySection(LoginMethod.SAML) && (
+ <>
+ {shouldShowCreateIdentityProviderView ? (
+ createIdentityProviderView
+ ) : (
<>
-
-
+ {isSamlConfigured && shouldDisplaySection(LoginMethod.SAML) && (
+
+
+
+
+ )}
+ {isOidcConfigured && shouldDisplaySection(LoginMethod.OIDC) &&
}
+ {isLdapConfigured && shouldDisplaySection(LoginMethod.LDAP) &&
}
>
)}
- {shouldDisplaySection(LoginMethod.OIDC) &&
}
- {shouldDisplaySection(LoginMethod.LDAP) &&
}
-
+ handlePopUpToggle("upgradePlan", isOpen)}
+ text={`You can use ${
+ (popUp.upgradePlan.data as { feature: string })?.feature
+ } if you switch to Infisical's ${
+ (popUp.upgradePlan.data as { plan: string })?.plan
+ } plan.`}
+ />
+ >
);
},
{ action: OrgPermissionActions.Read, subject: OrgPermissionSubjects.Sso }
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
index 6e4eca456b..778215f07b 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgGeneralAuthSection.tsx
@@ -87,7 +87,6 @@ export const OrgGeneralAuthSection = () => {
Enforce members to authenticate via SAML to access this organization
-
handlePopUpToggle("upgradePlan", isOpen)}
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgLDAPSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgLDAPSection.tsx
index 74d35d199c..49e07f8617 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgLDAPSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgLDAPSection.tsx
@@ -94,7 +94,7 @@ export const OrgLDAPSection = (): JSX.Element => {
};
return (
- <>
+
LDAP
@@ -151,7 +151,6 @@ export const OrgLDAPSection = (): JSX.Element => {
)}
-
{
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
text="You can use LDAP authentication if you switch to Infisical's Enterprise plan."
/>
- >
+
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgOIDCSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgOIDCSection.tsx
index 97c3063f0d..6ec56f7b31 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgOIDCSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgOIDCSection.tsx
@@ -60,7 +60,7 @@ export const OrgOIDCSection = (): JSX.Element => {
};
return (
- <>
+
OIDC
@@ -102,7 +102,6 @@ export const OrgOIDCSection = (): JSX.Element => {
)}
-
{
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
text="You can use OIDC SSO if you switch to Infisical's Pro plan."
/>
- >
+
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSCIMSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSCIMSection.tsx
index ffec3f3558..ba216ff3ad 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSCIMSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSCIMSection.tsx
@@ -57,7 +57,8 @@ export const OrgScimSection = () => {
};
return (
- <>
+
+
Provision users via SCIM
SCIM
@@ -68,7 +69,7 @@ export const OrgScimSection = () => {
colorSchema="secondary"
isDisabled={!isAllowed}
>
- Manage
+ Configure
)}
@@ -109,6 +110,6 @@ export const OrgScimSection = () => {
onOpenChange={(isOpen) => handlePopUpToggle("upgradePlan", isOpen)}
text="You can use SCIM Provisioning if you switch to Infisical's Enterprise plan."
/>
- >
+
);
};
diff --git a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSSOSection.tsx b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSSOSection.tsx
index bcb4f88378..3e5d778422 100644
--- a/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSSOSection.tsx
+++ b/frontend/src/views/Settings/OrgSettingsPage/components/OrgAuthTab/OrgSSOSection.tsx
@@ -115,7 +115,6 @@ export const OrgSSOSection = (): JSX.Element => {
Allow members to authenticate into Infisical with SAML
-
;
handlePopUpClose: (popUpName: keyof UsePopUpState<["addSSO"]>) => void;
handlePopUpToggle: (popUpName: keyof UsePopUpState<["addSSO"]>, state?: boolean) => void;
+ hideDelete?: boolean;
};
-export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props) => {
+export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle, hideDelete }: Props) => {
const { currentOrg } = useOrganization();
-
+
const { mutateAsync: createMutateAsync, isLoading: createIsLoading } = useCreateSSOConfig();
const { mutateAsync: updateMutateAsync, isLoading: updateIsLoading } = useUpdateSSOConfig();
+ const [isDeletePopupOpen, setIsDeletePopupOpen] = useToggle();
const { data } = useGetSSOConfig(currentOrg?.id ?? "");
const { control, handleSubmit, reset, watch } = useForm({
@@ -76,6 +80,31 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
}
}, [data]);
+ const handleSamlSoftDelete = async () => {
+ if (!currentOrg) {
+ return;
+ }
+ try {
+ await updateMutateAsync({
+ organizationId: currentOrg.id,
+ isActive: false,
+ entryPoint: "",
+ issuer: "",
+ cert: ""
+ });
+
+ createNotification({
+ text: "Successfully deleted SAML SSO configuration.",
+ type: "success"
+ });
+ } catch (err) {
+ createNotification({
+ text: "Failed deleting SAML SSO configuration.",
+ type: "error"
+ });
+ }
+ };
+
const onSSOModalSubmit = async ({ authProvider, entryPoint, issuer, cert }: AddSSOFormData) => {
try {
if (!currentOrg) return;
@@ -177,112 +206,133 @@ export const SSOModal = ({ popUp, handlePopUpClose, handlePopUpToggle }: Props)
const authProvider = watch("authProvider");
return (
- {
- handlePopUpToggle("addSSO", isOpen);
- reset();
- }}
- >
-
-
- (
-
- onChange(e)}
- className="w-full"
- >
- {ssoAuthProviders.map(({ label, value }) => (
-
- {label}
-
- ))}
-
-
+ <>
+ {
+ handlePopUpToggle("addSSO", isOpen);
+ reset();
+ }}
+ >
+
+
+ (
+
+ onChange(e)}
+ className="w-full"
+ >
+ {ssoAuthProviders.map(({ label, value }) => (
+
+ {label}
+
+ ))}
+
+
+ )}
+ />
+ {authProvider && data && (
+ <>
+
+
+ {renderLabels(authProvider).acsUrl}
+
+
{`${window.origin}/api/v1/sso/saml2/${data.id}`}
+
+
+
+ {renderLabels(authProvider).entityId}
+
+
{window.origin}
+
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ (
+
+
+
+ )}
+ />
+ >
)}
- />
- {authProvider && data && (
- <>
-
-
{renderLabels(authProvider).acsUrl}
-
{`${window.origin}/api/v1/sso/saml2/${data.id}`}
-
-
-
- {renderLabels(authProvider).entityId}
-
-
{window.origin}
-
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- (
-
-
-
- )}
- />
- >
- )}
-
-
- {!data ? "Add" : "Update"}
-
- handlePopUpClose("addSSO")}
- >
- Cancel
-
-
-
-
-
+
+
+
+ {!data ? "Add" : "Update"}
+
+ handlePopUpClose("addSSO")}
+ >
+ Cancel
+
+
+ {!hideDelete && (
+
setIsDeletePopupOpen.on()}>
+ Delete
+
+ )}
+
+
+
+
+ setIsDeletePopupOpen.toggle()}
+ deleteKey="confirm"
+ onDeleteApproved={handleSamlSoftDelete}
+ />
+ >
);
};