import { faInfoCircle, faWarning } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { UpgradePlanModal } from "@app/components/license/UpgradePlanModal"; import { createNotification } from "@app/components/notifications"; import { OrgPermissionCan } from "@app/components/permissions"; import { Button, Switch, Tooltip } from "@app/components/v2"; import { OrgPermissionActions, OrgPermissionSubjects, useOrganization, useSubscription } from "@app/context"; import { useGetOIDCConfig } from "@app/hooks/api"; import { useUpdateOIDCConfig } from "@app/hooks/api/oidcConfig/mutations"; import { usePopUp } from "@app/hooks/usePopUp"; import { OIDCModal } from "./OIDCModal"; export const OrgOIDCSection = (): JSX.Element => { const { currentOrg } = useOrganization(); const { subscription } = useSubscription(); const { data, isPending } = useGetOIDCConfig(currentOrg?.id ?? ""); const { mutateAsync } = useUpdateOIDCConfig(); const { popUp, handlePopUpOpen, handlePopUpClose, handlePopUpToggle } = usePopUp([ "addOIDC", "upgradePlan" ] as const); const handleOIDCToggle = async (value: boolean) => { try { if (!currentOrg?.id) return; if (!subscription?.oidcSSO) { handlePopUpOpen("upgradePlan"); return; } await mutateAsync({ organizationId: currentOrg?.id, isActive: value }); createNotification({ text: `Successfully ${value ? "enabled" : "disabled"} OIDC SSO`, type: "success" }); } catch (err) { console.error(err); } }; const handleOIDCGroupManagement = async (value: boolean) => { try { if (!currentOrg?.id) return; if (!subscription?.oidcSSO) { handlePopUpOpen("upgradePlan"); return; } await mutateAsync({ organizationId: currentOrg?.id, manageGroupMemberships: value }); createNotification({ text: `Successfully ${value ? "enabled" : "disabled"} OIDC group membership mapping`, type: "success" }); } catch (err) { console.error(err); } }; const addOidcButtonClick = async () => { if (subscription?.oidcSSO && currentOrg) { handlePopUpOpen("addOIDC"); } else { handlePopUpOpen("upgradePlan"); } }; const isGoogleOAuthEnabled = currentOrg.googleSsoAuthEnforced; return (

OIDC

Manage OIDC authentication configuration

{!isPending && ( {(isAllowed) => ( )} )}
{data && (

Enable OIDC

{!isPending && ( {(isAllowed) => (
handleOIDCToggle(value)} isChecked={data ? data.isActive : false} isDisabled={!isAllowed || isGoogleOAuthEnabled} />
)}
)}

Allow members to authenticate into Infisical with OIDC

)}
OIDC Group Membership Mapping

When this feature is enabled, Infisical will automatically sync group memberships between the OIDC provider and Infisical. Users will be added to Infisical groups that match their OIDC group names, and removed from any Infisical groups not present in their groups claim. When enabled, manual management of Infisical group memberships will be disabled.

To use this feature you must include group claims in the OIDC token.

See your OIDC provider docs for details.

Group membership changes in the OIDC provider only sync with Infisical when a user logs in via OIDC. For example, if you remove a user from a group in the OIDC provider, this change will not be reflected in Infisical until their next OIDC login. To ensure this behavior, Infisical recommends enabling Enforce OIDC SSO.

} >
{(isAllowed) => ( handleOIDCGroupManagement(value)} isDisabled={!isAllowed} /> )}

Infisical will manage user group memberships based on the OIDC provider

handlePopUpToggle("upgradePlan", isOpen)} text="You can use OIDC SSO if you switch to Infisical's Pro plan." />
); };