From 55b3a2460f0477558a8d293a087f7654475a0401 Mon Sep 17 00:00:00 2001 From: "mnissler@chromium.org" Date: Fri, 28 Mar 2014 11:13:52 +0000 Subject: Add error message for domain mismatch on re-enrollment. This error shows up if the server indicates to the client that enrollment got rejected due to the device belonging do a different domain (as indicated by the client-provided state key). BUG=chromium:357207 TEST=Manual, check that the error message shows up on domain mismatch. R=asvitkine@chromium.org, dpolukhin@chromium.org, joaodasilva@chromium.org Review URL: https://codereview.chromium.org/214963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260102 0039d316-1c4b-4281-b951-d872f2087c98 --- components/policy/core/browser/cloud/message_util.cc | 2 ++ components/policy/core/common/cloud/cloud_policy_constants.h | 2 ++ components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc | 1 + components/policy/core/common/cloud/device_management_service.cc | 4 ++++ components/policy/core/common/cloud/enterprise_metrics.h | 2 ++ components/policy_strings.grdp | 3 +++ 6 files changed, 14 insertions(+) (limited to 'components') diff --git a/components/policy/core/browser/cloud/message_util.cc b/components/policy/core/browser/cloud/message_util.cc index f394762..ea9f65e 100644 --- a/components/policy/core/browser/cloud/message_util.cc +++ b/components/policy/core/browser/cloud/message_util.cc @@ -42,6 +42,8 @@ int GetIDSForDMStatus(DeviceManagementStatus status) { return IDS_POLICY_DM_STATUS_SERVICE_MISSING_LICENSES; case DM_STATUS_SERVICE_DEPROVISIONED: return IDS_POLICY_DM_STATUS_SERVICE_DEPROVISIONED; + case DM_STATUS_SERVICE_DOMAIN_MISMATCH: + return IDS_POLICY_DM_STATUS_SERVICE_DOMAIN_MISMATCH; case DM_STATUS_SERVICE_POLICY_NOT_FOUND: return IDS_POLICY_DM_STATUS_SERVICE_POLICY_NOT_FOUND; } diff --git a/components/policy/core/common/cloud/cloud_policy_constants.h b/components/policy/core/common/cloud/cloud_policy_constants.h index 4f67f45..350cb42 100644 --- a/components/policy/core/common/cloud/cloud_policy_constants.h +++ b/components/policy/core/common/cloud/cloud_policy_constants.h @@ -95,6 +95,8 @@ enum DeviceManagementStatus { DM_STATUS_SERVICE_MISSING_LICENSES, // Service error: The administrator has deprovisioned this client. DM_STATUS_SERVICE_DEPROVISIONED, + // Service error: Device registration for the wrong domain. + DM_STATUS_SERVICE_DOMAIN_MISMATCH, // Service error: Policy not found. Error code defined by the DM folks. DM_STATUS_SERVICE_POLICY_NOT_FOUND = 902, }; diff --git a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc index ad221d1..9bc4a32 100644 --- a/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc +++ b/components/policy/core/common/cloud/cloud_policy_refresh_scheduler.cc @@ -304,6 +304,7 @@ void CloudPolicyRefreshScheduler::ScheduleRefresh() { case DM_STATUS_SERVICE_DEVICE_ID_CONFLICT: case DM_STATUS_SERVICE_MISSING_LICENSES: case DM_STATUS_SERVICE_DEPROVISIONED: + case DM_STATUS_SERVICE_DOMAIN_MISMATCH: // Need a re-registration, no use in retrying. refresh_callback_.Cancel(); return; diff --git a/components/policy/core/common/cloud/device_management_service.cc b/components/policy/core/common/cloud/device_management_service.cc index 95b9c3c..5d01ff8 100644 --- a/components/policy/core/common/cloud/device_management_service.cc +++ b/components/policy/core/common/cloud/device_management_service.cc @@ -41,6 +41,7 @@ const int kMissingLicenses = 402; const int kDeviceManagementNotAllowed = 403; const int kInvalidURL = 404; // This error is not coming from the GFE. const int kInvalidSerialNumber = 405; +const int kDomainMismatch = 406; const int kDeviceIdConflict = 409; const int kDeviceNotFound = 410; const int kPendingApproval = 412; @@ -259,6 +260,9 @@ void DeviceManagementRequestJobImpl::HandleResponse( case kInvalidSerialNumber: ReportError(DM_STATUS_SERVICE_INVALID_SERIAL_NUMBER); return; + case kDomainMismatch: + ReportError(DM_STATUS_SERVICE_DOMAIN_MISMATCH); + return; case kDeprovisioned: ReportError(DM_STATUS_SERVICE_DEPROVISIONED); return; diff --git a/components/policy/core/common/cloud/enterprise_metrics.h b/components/policy/core/common/cloud/enterprise_metrics.h index 7d5108e..f3af080 100644 --- a/components/policy/core/common/cloud/enterprise_metrics.h +++ b/components/policy/core/common/cloud/enterprise_metrics.h @@ -165,6 +165,8 @@ enum MetricEnrollment { kMetricEnrollmentRobotRefreshTokenStoreFailed, // Enrollment failed because the administrator has deprovisioned the device. kMetricEnrollmentDeprovisioned, + // Enrollment failed because the device doesn't belong to the domain. + kMetricEnrollmentDomainMismatch, kMetricEnrollmentSize // Must be the last. }; diff --git a/components/policy_strings.grdp b/components/policy_strings.grdp index c7a667c..443bd5b 100644 --- a/components/policy_strings.grdp +++ b/components/policy_strings.grdp @@ -43,6 +43,9 @@ Deprovisioned + + Domain mismatch + Policy not found -- cgit v1.1