Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1856)

Unified Diff: chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc

Issue 2403053003: Remove unused email from install attributes and add support for AD. (Closed)
Patch Set: Address Maksim's comments. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
index f62fb55e701fd190da53999d24db3bec41d281d3..384259c55424a77d4abd740b4e71fa0da7dd95ca 100644
--- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
+++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc
@@ -23,6 +23,7 @@
#include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/attestation/attestation_flow.h"
+#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_urls.h"
#include "net/http/http_status_code.h"
@@ -316,9 +317,10 @@ void EnrollmentHandlerChromeOS::HandlePolicyValidationResult(
DeviceCloudPolicyValidator* validator) {
CHECK_EQ(STEP_VALIDATION, enrollment_step_);
if (validator->success()) {
- policy_ = std::move(validator->policy());
- username_ = validator->policy_data()->username();
+ std::string username = validator->policy_data()->username();
+ domain_ = gaia::ExtractDomainName(gaia::CanonicalizeEmail(username));
device_id_ = validator->policy_data()->device_id();
+ policy_ = std::move(validator->policy());
request_token_ = validator->policy_data()->request_token();
enrollment_step_ = STEP_ROBOT_AUTH_FETCH;
client_->FetchRobotAuthCodes(auth_token_);
@@ -405,7 +407,7 @@ void EnrollmentHandlerChromeOS::StartLockDevice() {
weak_ptr_factory_.InvalidateWeakPtrs();
install_attributes_->LockDevice(
- username_, device_mode_, device_id_,
+ device_mode_, domain_, std::string() /* realm */, device_id_,
base::Bind(&EnrollmentHandlerChromeOS::HandleLockDeviceResult,
weak_ptr_factory_.GetWeakPtr()));
}
« no previous file with comments | « chrome/browser/chromeos/policy/enrollment_handler_chromeos.h ('k') | chrome/browser/chromeos/settings/install_attributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698