From 75212d81d4da888e9236aaf455bb6a96824d33f8 Mon Sep 17 00:00:00 2001 From: Gabriel Hernandez Date: Fri, 2 Jun 2023 14:14:39 +0100 Subject: [PATCH] Feat UI add end user auth to controls page (#11991) relates to #11002 Implements the UI for mdm macos setup end user authentication page. ![image](https://github.com/fleetdm/fleet/assets/1153709/1af6c5d7-99d0-401d-9938-a78617eca817) ![image](https://github.com/fleetdm/fleet/assets/1153709/8f0ed8cc-63f5-425b-8f3a-f2f83ed018f7) - [x] Changes file added for user-visible changes in `changes/` or `orbit/changes/`. - [x] Manual QA for all new/changed functionality --- ...002-add-mdm-macos-setup-end-user-auth-page | 1 + .../SectionHeader/SectionHeader.stories.tsx | 15 +++ .../SectionHeader/SectionHeader.tsx | 13 +++ .../components/SectionHeader/_styles.scss | 8 ++ frontend/components/SectionHeader/index.ts | 1 + .../forms/fields/Checkbox/Checkbox.tsx | 4 +- frontend/interfaces/config.ts | 5 + frontend/interfaces/team.ts | 2 + .../MacOSSetup/MacOSSetup.tsx | 10 +- .../MacOSSetup/MacOSSetupNavItems.tsx | 7 ++ .../EndUserAuthentication.tsx | 110 ++++++++++++++++++ .../cards/EndUserAuthentication/_styles.scss | 16 +++ .../EndUserAuthForm/EndUserAuthForm.tsx | 70 +++++++++++ .../components/EndUserAuthForm/_styles.scss | 7 ++ .../components/EndUserAuthForm/index.ts | 1 + .../RequireEndUserAuth/RequireEndUserAuth.tsx | 29 +++++ .../RequireEndUserAuth/_styles.scss | 7 ++ .../components/RequireEndUserAuth/index.ts | 1 + .../cards/EndUserAuthentication/index.ts | 1 + .../EndUserExperiencePreview.tsx | 34 ++++++ .../EndUserExperiencePreview/_styles.scss | 19 +++ .../EndUserExperiencePreview/index.ts | 1 + frontend/router/paths.ts | 1 + frontend/services/entities/mdm.ts | 8 ++ frontend/utilities/endpoints.ts | 1 + 25 files changed, 367 insertions(+), 5 deletions(-) create mode 100644 changes/issue-11002-add-mdm-macos-setup-end-user-auth-page create mode 100644 frontend/components/SectionHeader/SectionHeader.stories.tsx create mode 100644 frontend/components/SectionHeader/SectionHeader.tsx create mode 100644 frontend/components/SectionHeader/_styles.scss create mode 100644 frontend/components/SectionHeader/index.ts create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/EndUserAuthentication.tsx create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/_styles.scss create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/EndUserAuthForm.tsx create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/_styles.scss create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/index.ts create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/RequireEndUserAuth.tsx create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/_styles.scss create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/index.ts create mode 100644 frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/index.ts create mode 100644 frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/EndUserExperiencePreview.tsx create mode 100644 frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/_styles.scss create mode 100644 frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/index.ts diff --git a/changes/issue-11002-add-mdm-macos-setup-end-user-auth-page b/changes/issue-11002-add-mdm-macos-setup-end-user-auth-page new file mode 100644 index 0000000000..70e31fe96a --- /dev/null +++ b/changes/issue-11002-add-mdm-macos-setup-end-user-auth-page @@ -0,0 +1 @@ +- add UI for the end user authentication page for mdm macos setup diff --git a/frontend/components/SectionHeader/SectionHeader.stories.tsx b/frontend/components/SectionHeader/SectionHeader.stories.tsx new file mode 100644 index 0000000000..8cd3d14844 --- /dev/null +++ b/frontend/components/SectionHeader/SectionHeader.stories.tsx @@ -0,0 +1,15 @@ +import { Meta, StoryObj } from "@storybook/react"; + +import SectionHeader from "."; + +const meta: Meta = { + title: "Components/SectionHeader", + component: SectionHeader, + args: { title: "Section header title" }, +}; + +export default meta; + +type Story = StoryObj; + +export const Basic: Story = {}; diff --git a/frontend/components/SectionHeader/SectionHeader.tsx b/frontend/components/SectionHeader/SectionHeader.tsx new file mode 100644 index 0000000000..fb4e115388 --- /dev/null +++ b/frontend/components/SectionHeader/SectionHeader.tsx @@ -0,0 +1,13 @@ +import React from "react"; + +const baseClass = "section-header"; + +interface ISectionHeaderProps { + title: string; +} + +const SectionHeader = ({ title }: ISectionHeaderProps) => { + return

{title}

; +}; + +export default SectionHeader; diff --git a/frontend/components/SectionHeader/_styles.scss b/frontend/components/SectionHeader/_styles.scss new file mode 100644 index 0000000000..a92926f72d --- /dev/null +++ b/frontend/components/SectionHeader/_styles.scss @@ -0,0 +1,8 @@ +.section-header { + margin: 0 0 $pad-large; + padding-bottom: $pad-small; + font-size: $medium; + font-weight: $regular; + color: $core-fleet-black; + border-bottom: solid 1px $ui-fleet-black-10; +} diff --git a/frontend/components/SectionHeader/index.ts b/frontend/components/SectionHeader/index.ts new file mode 100644 index 0000000000..4c0221e759 --- /dev/null +++ b/frontend/components/SectionHeader/index.ts @@ -0,0 +1 @@ +export { default } from "./SectionHeader"; diff --git a/frontend/components/forms/fields/Checkbox/Checkbox.tsx b/frontend/components/forms/fields/Checkbox/Checkbox.tsx index 14980dacc0..c8daf7bfea 100644 --- a/frontend/components/forms/fields/Checkbox/Checkbox.tsx +++ b/frontend/components/forms/fields/Checkbox/Checkbox.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import React, { ReactNode } from "react"; import classnames from "classnames"; import { noop, pick } from "lodash"; @@ -9,7 +9,7 @@ import TooltipWrapper from "components/TooltipWrapper"; const baseClass = "fleet-checkbox"; export interface ICheckboxProps { - children?: JSX.Element | Array | string; + children?: ReactNode; className?: string; disabled?: boolean; name?: string; diff --git a/frontend/interfaces/config.ts b/frontend/interfaces/config.ts index 3558c256aa..cb5f6b728d 100644 --- a/frontend/interfaces/config.ts +++ b/frontend/interfaces/config.ts @@ -123,6 +123,11 @@ export interface IMdmConfig { custom_settings: null; enable_disk_encryption: boolean; }; + macos_setup: { + bootstrap_package: string | null; + enable_end_user_authentication: boolean; + macos_setup_assistant: string | null; + }; macos_migration: IMacOsMigrationSettings; } diff --git a/frontend/interfaces/team.ts b/frontend/interfaces/team.ts index 0a8fb206c7..3c06c11c36 100644 --- a/frontend/interfaces/team.ts +++ b/frontend/interfaces/team.ts @@ -54,6 +54,8 @@ export interface ITeam extends ITeamSummary { }; macos_setup: { bootstrap_package: string | null; + enable_end_user_authentication: boolean; + macos_setup_assistant: string | null; // TODO: types? }; }; } diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetup.tsx b/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetup.tsx index e36f0529d0..c5dd0f1c7d 100644 --- a/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetup.tsx +++ b/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetup.tsx @@ -1,6 +1,6 @@ import React, { useContext } from "react"; import PATHS from "router/paths"; -import { Params } from "react-router/lib/Router"; +import { InjectedRouter, Params } from "react-router/lib/Router"; import { AppContext } from "context/app"; @@ -14,7 +14,7 @@ import MAC_OS_SETUP_NAV_ITEMS from "./MacOSSetupNavItems"; const baseClass = "macos-setup"; interface ISetupEmptyState { - router: any; + router: InjectedRouter; } const SetupEmptyState = ({ router }: ISetupEmptyState) => { @@ -80,7 +80,11 @@ const MacOSSetup = ({ }))} activeItem={currentFormSection.urlSection} CurrentCard={ - + } /> )} diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetupNavItems.tsx b/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetupNavItems.tsx index 47658f200d..a49b221fea 100644 --- a/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetupNavItems.tsx +++ b/frontend/pages/ManageControlsPage/MacOSSetup/MacOSSetupNavItems.tsx @@ -2,6 +2,7 @@ import PATHS from "router/paths"; import { ISideNavItem } from "pages/admin/components/SideNav/SideNav"; +import EndUserAuthentication from "./cards/EndUserAuthentication/EndUserAuthentication"; import BootstrapPackage from "./cards/BootstrapPackage"; interface IMacOSSetupCardProps { @@ -10,6 +11,12 @@ interface IMacOSSetupCardProps { // TODO: types const MAC_OS_SETUP_NAV_ITEMS: ISideNavItem[] = [ + { + title: "End user authentication", + urlSection: "end-user-auth", + path: PATHS.CONTROLS_END_USER_AUTHENTICATION, + Card: EndUserAuthentication, + }, { title: "Bootstrap package", urlSection: "bootstrap-package", diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/EndUserAuthentication.tsx b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/EndUserAuthentication.tsx new file mode 100644 index 0000000000..99847f9b06 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/EndUserAuthentication.tsx @@ -0,0 +1,110 @@ +import React from "react"; +import { InjectedRouter } from "react-router"; +import PATHS from "router/paths"; + +import configAPI from "services/entities/config"; +import teamsAPI, { ILoadTeamResponse } from "services/entities/teams"; +import { IConfig } from "interfaces/config"; + +import SectionHeader from "components/SectionHeader/SectionHeader"; +import EndUserExperiencePreview from "pages/ManageControlsPage/components/EndUserExperiencePreview"; +import { useQuery } from "react-query"; +import { ITeamConfig } from "interfaces/team"; +import Spinner from "components/Spinner"; +import RequireEndUserAuth from "./components/RequireEndUserAuth/RequireEndUserAuth"; +import EndUserAuthForm from "./components/EndUserAuthForm/EndUserAuthForm"; + +const baseClass = "end-user-authentication"; + +const getEnabledEndUserAuth = ( + currentTeamId: number, + globalConfig?: IConfig, + teamConfig?: ITeamConfig +) => { + if (globalConfig === undefined && teamConfig === undefined) { + return false; + } + + // team is "No team" when currentTeamId === 0 + if (currentTeamId === 0) { + return ( + globalConfig?.mdm?.macos_setup.enable_end_user_authentication ?? false + ); + } + + return teamConfig?.mdm?.macos_setup.enable_end_user_authentication ?? false; +}; + +interface IEndUserAuthenticationProps { + currentTeamId: number; + router: InjectedRouter; +} + +const EndUserAuthentication = ({ + currentTeamId, + router, +}: IEndUserAuthenticationProps) => { + const { data: globalConfig, isLoading: isLoadingGlobalConfig } = useQuery< + IConfig, + Error + >(["config"], () => configAPI.loadAll(), { + refetchOnWindowFocus: false, + retry: false, + enabled: currentTeamId === 0, + }); + + const { data: teamConfig, isLoading: isLoadingTeamConfig } = useQuery< + ILoadTeamResponse, + Error, + ITeamConfig + >(["team", currentTeamId], () => teamsAPI.load(currentTeamId), { + refetchOnWindowFocus: false, + retry: false, + enabled: currentTeamId !== 0, + select: (res) => res.team, + }); + + const defaultIsEndUserAuthEnabled = getEnabledEndUserAuth( + currentTeamId, + globalConfig, + teamConfig + ); + + const onClickConnect = () => { + router.push(PATHS.ADMIN_INTEGRATIONS_AUTOMATIC_ENROLLMENT); + }; + + return ( +
+ + {isLoadingGlobalConfig || isLoadingTeamConfig ? ( + + ) : ( +
+ {true ? ( + + ) : ( + + )} + {/* TODO: get gif */} + +

+ When the end user reaches the Remote Management pane in the + macOS Setup Assistant, they are asked to authenticate and agree to + the end user license agreement (EULA). +

+

+ After, Fleet enrolls the Mac, applies macOS settings, and installs + the bootstrap package. +

+
+
+ )} +
+ ); +}; + +export default EndUserAuthentication; diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/_styles.scss b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/_styles.scss new file mode 100644 index 0000000000..41eb5e8ff0 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/_styles.scss @@ -0,0 +1,16 @@ +.end-user-authentication { + + &__content { + max-width: $break-1600; + margin: 0 auto; + display: flex; + justify-content: space-between; + gap: $pad-xxlarge; + } + + @media (max-width: $break-990) { + &__content { + flex-direction: column; + } + } +} diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/EndUserAuthForm.tsx b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/EndUserAuthForm.tsx new file mode 100644 index 0000000000..d0dcedb4e6 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/EndUserAuthForm.tsx @@ -0,0 +1,70 @@ +import React, { useContext, useState } from "react"; +import { Link } from "react-router"; + +import PATHS from "router/paths"; +import mdmAPI from "services/entities/mdm"; + +import Button from "components/buttons/Button"; +import Checkbox from "components/forms/fields/Checkbox"; +import { NotificationContext } from "context/notification"; + +const baseClass = "end-user-auth-form"; + +interface IEndUserAuthFormProps { + currentTeamId: number; + defaultIsEndUserAuthEnabled: boolean; +} + +const EndUserAuthForm = ({ + currentTeamId, + defaultIsEndUserAuthEnabled, +}: IEndUserAuthFormProps) => { + const { renderFlash } = useContext(NotificationContext); + + const [isEndUserAuthEnabled, setEndUserAuthEnabled] = useState( + defaultIsEndUserAuthEnabled + ); + const [isUpdating, setIsUpdating] = useState(false); + + const onToggleEndUserAuth = (newCheckVal: boolean) => { + setEndUserAuthEnabled(newCheckVal); + }; + + const onClickSave = async () => { + setIsUpdating(true); + try { + await mdmAPI.updateEndUserAuthentication( + currentTeamId, + isEndUserAuthEnabled + ); + renderFlash("success", "Successfully updated!"); + } catch { + renderFlash("error", "Couldn’t update. Please try again."); + } finally { + setIsUpdating(false); + } + }; + + return ( +
+
+ + On + +

+ Require end users to authenticate with your identity provider (IdP) + and agree to an end user license agreement (EULA) when they setup + their new macOS hosts.{" "} + + View IdP and EULA + +

+ +
+
+ ); +}; + +export default EndUserAuthForm; diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/_styles.scss b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/_styles.scss new file mode 100644 index 0000000000..9927476df6 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/_styles.scss @@ -0,0 +1,7 @@ +.end-user-auth-form { + + form > p { + font-size: $x-small; + margin: 0 0 $pad-large; + } +} diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/index.ts b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/index.ts new file mode 100644 index 0000000000..65d8a833f6 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/EndUserAuthForm/index.ts @@ -0,0 +1 @@ +export { default } from "./EndUserAuthForm"; diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/RequireEndUserAuth.tsx b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/RequireEndUserAuth.tsx new file mode 100644 index 0000000000..d0f522c941 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/RequireEndUserAuth.tsx @@ -0,0 +1,29 @@ +import React from "react"; + +import EmptyTable from "components/EmptyTable"; +import Button from "components/buttons/Button/Button"; + +const baseClass = "require-end-user-auth"; + +interface IRequireEndUserAuthProps { + onClickConnect: () => void; +} + +const RequireEndUserAuth = ({ onClickConnect }: IRequireEndUserAuthProps) => { + return ( +
+ + Connect + + } + className={`${baseClass}__required-message`} + /> +
+ ); +}; + +export default RequireEndUserAuth; diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/_styles.scss b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/_styles.scss new file mode 100644 index 0000000000..403d6dad59 --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/_styles.scss @@ -0,0 +1,7 @@ +.require-end-user-auth { + width: 100%; + + &__required-message { + margin-top: 0; + } +} diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/index.ts b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/index.ts new file mode 100644 index 0000000000..80fb9f314b --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/components/RequireEndUserAuth/index.ts @@ -0,0 +1 @@ +export { default } from "./RequireEndUserAuth"; diff --git a/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/index.ts b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/index.ts new file mode 100644 index 0000000000..a071db675f --- /dev/null +++ b/frontend/pages/ManageControlsPage/MacOSSetup/cards/EndUserAuthentication/index.ts @@ -0,0 +1 @@ +export { default } from "./EndUserAuthentication"; diff --git a/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/EndUserExperiencePreview.tsx b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/EndUserExperiencePreview.tsx new file mode 100644 index 0000000000..81fe5808e8 --- /dev/null +++ b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/EndUserExperiencePreview.tsx @@ -0,0 +1,34 @@ +import classnames from "classnames"; +import React from "react"; + +const baseClass = "end-user-experience-preview"; + +interface IEndUserExperiencePerviewProps { + previewImage: string; + altText?: string; + children?: React.ReactNode; + className?: string; +} + +const EndUserExperiencePerview = ({ + previewImage, + altText = "end user experience preview", + children, + className, +}: IEndUserExperiencePerviewProps) => { + const classes = classnames(baseClass, className); + + return ( +
+

End user experience

+ <>{children} + {altText} +
+ ); +}; + +export default EndUserExperiencePerview; diff --git a/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/_styles.scss b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/_styles.scss new file mode 100644 index 0000000000..83258a927d --- /dev/null +++ b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/_styles.scss @@ -0,0 +1,19 @@ +.end-user-experience-preview { + background-color: $ui-off-white; + border-radius: $border-radius; + border: 1px solid $ui-fleet-black-10; + padding: $pad-xxlarge; + font-size: $x-small; + + h3 { + margin: 0; + font-size: $x-small; + } + + &__preview-img { + margin-top: $pad-xxlarge; + width: 100%; + display: block; + margin: 40px auto 0; + } +} diff --git a/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/index.ts b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/index.ts new file mode 100644 index 0000000000..9e7279ddaa --- /dev/null +++ b/frontend/pages/ManageControlsPage/components/EndUserExperiencePreview/index.ts @@ -0,0 +1 @@ +export { default } from "./EndUserExperiencePreview"; diff --git a/frontend/router/paths.ts b/frontend/router/paths.ts index f15bd9cee7..949a00182c 100644 --- a/frontend/router/paths.ts +++ b/frontend/router/paths.ts @@ -10,6 +10,7 @@ export default { CONTROLS_CUSTOM_SETTINGS: `${URL_PREFIX}/controls/mac-settings/custom-settings`, CONTROLS_DISK_ENCRYPTION: `${URL_PREFIX}/controls/mac-settings/disk-encryption`, CONTROLS_MAC_SETUP: `${URL_PREFIX}/controls/mac-setup`, + CONTROLS_END_USER_AUTHENTICATION: `${URL_PREFIX}/controls/mac-setup/end-user-auth`, CONTROLS_BOOTSTRAP_PACKAGE: `${URL_PREFIX}/controls/mac-setup/bootstrap-package`, CONTROLS_MAC_SCRIPTS: `${URL_PREFIX}/controls/mac-scripts`, DASHBOARD: `${URL_PREFIX}/dashboard`, diff --git a/frontend/services/entities/mdm.ts b/frontend/services/entities/mdm.ts index 4c10670085..c5c36275d5 100644 --- a/frontend/services/entities/mdm.ts +++ b/frontend/services/entities/mdm.ts @@ -167,4 +167,12 @@ export default { const { MDM_EULA } = endpoints; return sendRequest("GET", MDM_EULA(token)); }, + + updateEndUserAuthentication: (teamId: number, isEnabled: boolean) => { + const { MDM_SETUP } = endpoints; + return sendRequest("PATCH", MDM_SETUP, { + team_id: teamId, + enable_end_user_authentication: isEnabled, + }); + }, }; diff --git a/frontend/utilities/endpoints.ts b/frontend/utilities/endpoints.ts index 162951a45c..8e44c29a09 100644 --- a/frontend/utilities/endpoints.ts +++ b/frontend/utilities/endpoints.ts @@ -61,6 +61,7 @@ export default { `/${API_VERSION}/fleet/mdm/apple/bootstrap/${teamId}/metadata`, MDM_BOOTSTRAP_PACKAGE: `/${API_VERSION}/fleet/mdm/apple/bootstrap`, MDM_BOOTSTRAP_PACKAGE_SUMMARY: `/${API_VERSION}/fleet/mdm/apple/bootstrap/summary`, + MDM_SETUP: `/${API_VERSION}/fleet/mdm/apple/setup`, MDM_EULA: (token: string) => `/${API_VERSION}/fleet/mdm/apple/setup/eula/${token}`, MDM_EULA_UPLOAD: `/${API_VERSION}/fleet/mdm/apple/setup/eula`,