From c1aa0f04b62ef5f9e129ad464b45a3ea21b5ffc5 Mon Sep 17 00:00:00 2001 From: Roberto Dip Date: Wed, 22 Mar 2023 10:00:41 -0300 Subject: [PATCH] fix DEP enrollment by setting configuration_web_url if empty (#10662) https://github.com/fleetdm/fleet/issues/10661 - [x] Manual QA for all new/changed functionality --- server/service/apple_mdm.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/service/apple_mdm.go b/server/service/apple_mdm.go index add4516e56..5d210b31a1 100644 --- a/server/service/apple_mdm.go +++ b/server/service/apple_mdm.go @@ -124,6 +124,13 @@ func (svc *Service) setDEPProfile(ctx context.Context, enrollmentProfile *fleet. // Override url with Fleet's enroll path (publicly accessible address). depProfileRequest.URL = enrollURL + // If the profile doesn't have a configuration_web_url, use Fleet's + // enrollURL, otherwise the request for the enrollment profile is + // submitted as a POST instead of GET. + if depProfileRequest.ConfigurationWebURL == "" { + depProfileRequest.ConfigurationWebURL = enrollURL + } + depClient := apple_mdm.NewDEPClient(svc.depStorage, svc.ds, svc.logger) res, err := depClient.DefineProfile(ctx, apple_mdm.DEPName, &depProfileRequest) if err != nil {