Commit 1ab06323 authored by Danila Kuzmin's avatar Danila Kuzmin Committed by Commit Bot

oobe: Add error message for illegal enrollment for packaged EDU license

When user tries to enroll their CBEdu into a non-EDU account (e.g.
enterprise) they will see a new error message, added in this CL.

Bug: 1113395
Change-Id: Ib73244dc65e98be6c3497e9b711dae67411b897c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2465746Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Cr-Commit-Position: refs/heads/master@{#822104}
parent fb27f7ea
...@@ -3355,6 +3355,9 @@ ...@@ -3355,6 +3355,9 @@
<message name="IDS_ENTERPRISE_ENROLLMENT_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED" desc="Error message to show when the user tries to enroll a device, but administrator has not accepted TOS."> <message name="IDS_ENTERPRISE_ENROLLMENT_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED" desc="Error message to show when the user tries to enroll a device, but administrator has not accepted TOS.">
Your administrator must first accept the terms of service in the Admin console Chrome device list. Your administrator must first accept the terms of service in the Admin console Chrome device list.
</message> </message>
<message name="IDS_ENTERPRISE_ENROLLMENT_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE" desc="Error message to show when the user tries to enroll a CBEdu device into non-EDU account.">
You must enroll this Chrome Education device into an education account. To sign up for a new account, please visit https://g.co/workspace/edusignup.
</message>
<message name="IDS_ENTERPRISE_ENROLLMENT_ATTRIBUTE_ERROR" desc="Error message shown when successfully enrolled, but the device attribute update has failed."> <message name="IDS_ENTERPRISE_ENROLLMENT_ATTRIBUTE_ERROR" desc="Error message shown when successfully enrolled, but the device attribute update has failed.">
Your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> has successfully been enrolled for enterprise management, but failed to send its asset and location information. Please manually enter this information from your Admin console for this device. Your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> has successfully been enrolled for enterprise management, but failed to send its asset and location information. Please manually enter this information from your Admin console for this device.
</message> </message>
......
...@@ -164,6 +164,7 @@ DemoSetupController::DemoSetupError CreateFromClientStatus( ...@@ -164,6 +164,7 @@ DemoSetupController::DemoSetupError CreateFromClientStatus(
case policy::DM_STATUS_SERVICE_ACTIVATION_PENDING: case policy::DM_STATUS_SERVICE_ACTIVATION_PENDING:
case policy::DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL: case policy::DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL:
case policy::DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED: case policy::DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED:
case policy::DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE:
return DemoSetupController::DemoSetupError(ErrorCode::kDemoAccountError, return DemoSetupController::DemoSetupError(ErrorCode::kDemoAccountError,
RecoveryMethod::kUnknown, RecoveryMethod::kUnknown,
debug_message); debug_message);
......
...@@ -440,6 +440,21 @@ IN_PROC_BROWSER_TEST_F(EnrollmentLocalPolicyServerBase, ...@@ -440,6 +440,21 @@ IN_PROC_BROWSER_TEST_F(EnrollmentLocalPolicyServerBase,
EXPECT_FALSE(InstallAttributes::Get()->IsEnterpriseManaged()); EXPECT_FALSE(InstallAttributes::Get()->IsEnterpriseManaged());
} }
IN_PROC_BROWSER_TEST_F(EnrollmentLocalPolicyServerBase,
EnrollmentErrorIllegalAccountForPackagedEDULicense) {
policy_server_.SetExpectedDeviceEnrollmentError(907);
TriggerEnrollmentAndSignInSuccessfully();
enrollment_ui_.WaitForStep(test::ui::kEnrollmentStepError);
enrollment_ui_.ExpectErrorMessage(
IDS_ENTERPRISE_ENROLLMENT_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE,
/* can retry */ true);
enrollment_ui_.RetryAfterError();
EXPECT_FALSE(StartupUtils::IsDeviceRegistered());
EXPECT_FALSE(InstallAttributes::Get()->IsEnterpriseManaged());
}
// Error during enrollment : Strange HTTP response from server. // Error during enrollment : Strange HTTP response from server.
IN_PROC_BROWSER_TEST_F(EnrollmentLocalPolicyServerBase, IN_PROC_BROWSER_TEST_F(EnrollmentLocalPolicyServerBase,
EnrollmentErrorServerIsDrunk) { EnrollmentErrorServerIsDrunk) {
......
...@@ -462,6 +462,9 @@ void EnterpriseEnrollmentHelperImpl::ReportEnrollmentStatus( ...@@ -462,6 +462,9 @@ void EnterpriseEnrollmentHelperImpl::ReportEnrollmentStatus(
case policy::DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED: case policy::DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED:
UMA(policy::kMetricEnrollmentRegisterEnterpriseTosHasNotBeenAccepted); UMA(policy::kMetricEnrollmentRegisterEnterpriseTosHasNotBeenAccepted);
break; break;
case policy::DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE:
UMA(policy::kMetricEnrollmentIllegalAccountForPackagedEDULicense);
break;
} }
break; break;
case policy::EnrollmentStatus::REGISTRATION_BAD_MODE: case policy::EnrollmentStatus::REGISTRATION_BAD_MODE:
......
...@@ -426,6 +426,11 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus( ...@@ -426,6 +426,11 @@ void EnrollmentScreenHandler::ShowEnrollmentStatus(
IDS_ENTERPRISE_ENROLLMENT_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED, IDS_ENTERPRISE_ENROLLMENT_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED,
true); true);
break; break;
case policy::DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE:
ShowError(
IDS_ENTERPRISE_ENROLLMENT_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE,
true);
break;
default: default:
ShowErrorMessage( ShowErrorMessage(
l10n_util::GetStringFUTF8( l10n_util::GetStringFUTF8(
......
...@@ -62,6 +62,8 @@ int GetIDSForDMStatus(DeviceManagementStatus status) { ...@@ -62,6 +62,8 @@ int GetIDSForDMStatus(DeviceManagementStatus status) {
case DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED: case DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED:
// This is shown only on registration failed. // This is shown only on registration failed.
return IDS_POLICY_DM_STATUS_UNKNOWN_ERROR; return IDS_POLICY_DM_STATUS_UNKNOWN_ERROR;
case DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE:
return IDS_POLICY_DM_STATUS_SERVICE_DOMAIN_MISMATCH;
} }
NOTREACHED() << "Unhandled DM status " << status; NOTREACHED() << "Unhandled DM status " << status;
return IDS_POLICY_DM_STATUS_UNKNOWN_ERROR; return IDS_POLICY_DM_STATUS_UNKNOWN_ERROR;
......
...@@ -141,6 +141,8 @@ enum DeviceManagementStatus { ...@@ -141,6 +141,8 @@ enum DeviceManagementStatus {
DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL = 906, DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL = 906,
// Service error: Enterprise TOS has not been accepted. // Service error: Enterprise TOS has not been accepted.
DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED = 907, DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED = 907,
// Service error: Illegal account for packaged EDU license.
DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE = 908,
}; };
// List of modes that the device can be locked into. // List of modes that the device can be locked into.
......
...@@ -328,6 +328,7 @@ void CloudPolicyRefreshScheduler::ScheduleRefresh() { ...@@ -328,6 +328,7 @@ void CloudPolicyRefreshScheduler::ScheduleRefresh() {
case DM_STATUS_SERVICE_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE: case DM_STATUS_SERVICE_CONSUMER_ACCOUNT_WITH_PACKAGED_LICENSE:
case DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL: case DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL:
case DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED: case DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED:
case DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE:
// Need a re-registration, no use in retrying. // Need a re-registration, no use in retrying.
CancelRefresh(); CancelRefresh();
return; return;
......
...@@ -546,6 +546,7 @@ static const ClientErrorTestParam kClientErrorTestCases[] = { ...@@ -546,6 +546,7 @@ static const ClientErrorTestParam kClientErrorTestCases[] = {
{DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL, -1, 1}, {DM_STATUS_SERVICE_ENTERPRISE_ACCOUNT_IS_NOT_ELIGIBLE_TO_ENROLL, -1, 1},
{DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED, -1, 1}, {DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED, -1, 1},
{DM_STATUS_SERVICE_TOO_MANY_REQUESTS, kPolicyRefreshRate, 1}, {DM_STATUS_SERVICE_TOO_MANY_REQUESTS, kPolicyRefreshRate, 1},
{DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE, -1, 1},
}; };
class CloudPolicyRefreshSchedulerClientErrorTest class CloudPolicyRefreshSchedulerClientErrorTest
......
...@@ -126,6 +126,7 @@ const int DeviceManagementService::kDeprovisioned; ...@@ -126,6 +126,7 @@ const int DeviceManagementService::kDeprovisioned;
const int DeviceManagementService::kArcDisabled; const int DeviceManagementService::kArcDisabled;
const int DeviceManagementService::kInvalidDomainlessCustomer; const int DeviceManagementService::kInvalidDomainlessCustomer;
const int DeviceManagementService::kTosHasNotBeenAccepted; const int DeviceManagementService::kTosHasNotBeenAccepted;
const int DeviceManagementService::kIllegalAccountForPackagedEDULicense;
// static // static
std::string DeviceManagementService::JobConfiguration::GetJobTypeAsString( std::string DeviceManagementService::JobConfiguration::GetJobTypeAsString(
......
...@@ -88,6 +88,7 @@ class POLICY_EXPORT DeviceManagementService { ...@@ -88,6 +88,7 @@ class POLICY_EXPORT DeviceManagementService {
static constexpr int kArcDisabled = 904; static constexpr int kArcDisabled = 904;
static constexpr int kInvalidDomainlessCustomer = 905; static constexpr int kInvalidDomainlessCustomer = 905;
static constexpr int kTosHasNotBeenAccepted = 906; static constexpr int kTosHasNotBeenAccepted = 906;
static constexpr int kIllegalAccountForPackagedEDULicense = 907;
// Number of times to retry on ERR_NETWORK_CHANGED errors. // Number of times to retry on ERR_NETWORK_CHANGED errors.
static const int kMaxRetries = 3; static const int kMaxRetries = 3;
......
...@@ -463,6 +463,11 @@ INSTANTIATE_TEST_SUITE_P( ...@@ -463,6 +463,11 @@ INSTANTIATE_TEST_SUITE_P(
net::OK, net::OK,
906, 906,
PROTO_STRING(kResponseEmpty)), PROTO_STRING(kResponseEmpty)),
FailedRequestParams(
DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE,
net::OK,
907,
PROTO_STRING(kResponseEmpty)),
FailedRequestParams(DM_STATUS_REQUEST_TOO_LARGE, FailedRequestParams(DM_STATUS_REQUEST_TOO_LARGE,
net::OK, net::OK,
413, 413,
......
...@@ -204,6 +204,9 @@ DMServerJobConfiguration::MapNetErrorAndResponseCodeToDMStatus( ...@@ -204,6 +204,9 @@ DMServerJobConfiguration::MapNetErrorAndResponseCodeToDMStatus(
case DeviceManagementService::kTosHasNotBeenAccepted: case DeviceManagementService::kTosHasNotBeenAccepted:
code = DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED; code = DM_STATUS_SERVICE_ENTERPRISE_TOS_HAS_NOT_BEEN_ACCEPTED;
break; break;
case DeviceManagementService::kIllegalAccountForPackagedEDULicense:
code = DM_STATUS_SERVICE_ILLEGAL_ACCOUNT_FOR_PACKAGED_EDU_LICENSE;
break;
default: default:
// Handle all unknown 5xx HTTP error codes as temporary and any other // Handle all unknown 5xx HTTP error codes as temporary and any other
// unknown error as one that needs more time to recover. // unknown error as one that needs more time to recover.
......
...@@ -140,8 +140,10 @@ enum MetricEnrollment { ...@@ -140,8 +140,10 @@ enum MetricEnrollment {
kMetricEnrollmentRegisterEnterpriseTosHasNotBeenAccepted = 61, kMetricEnrollmentRegisterEnterpriseTosHasNotBeenAccepted = 61,
// Too many requests are uploadede within a short time. // Too many requests are uploadede within a short time.
kMetricEnrollmentTooManyRequests = 62, kMetricEnrollmentTooManyRequests = 62,
// Enrollment failed: illegal account for packaged EDU license.
kMetricEnrollmentIllegalAccountForPackagedEDULicense = 63,
// Max value for use with enumeration histogram UMA functions. // Max value for use with enumeration histogram UMA functions.
kMaxValue = kMetricEnrollmentTooManyRequests kMaxValue = kMetricEnrollmentIllegalAccountForPackagedEDULicense
}; };
// Events related to policy refresh. // Events related to policy refresh.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment