summaryrefslogtreecommitdiffstats
path: root/components/user_manager
diff options
context:
space:
mode:
authordzhioev <dzhioev@chromium.org>2015-05-15 14:53:10 -0700
committerCommit bot <commit-bot@chromium.org>2015-05-15 21:54:05 +0000
commita912deca5f760681835e4247225c1c83b656d0b5 (patch)
tree86b30d8383919c9b9f8cca5356d36514b8168021 /components/user_manager
parent0272cae5fa1c70ec751fd5dd19b31a368babc0c8 (diff)
downloadchromium_src-a912deca5f760681835e4247225c1c83b656d0b5.zip
chromium_src-a912deca5f760681835e4247225c1c83b656d0b5.tar.gz
chromium_src-a912deca5f760681835e4247225c1c83b656d0b5.tar.bz2
Implemented sending Device ID to LSO in "oauth2/token".
The only place where Device ID is stored on Chrome OS is the local state from now on. Order of events: 1) User logs in. There are two options: a) User athenticated through GAIA. We read known user device ID from local state if it exists or generate a new one if it doesn't. Then we save the device ID in a user context. b) Otherwise, we don't store device ID in user context. 2) If it is GAIA_WITHOUT_SAML-mode, we send device ID to LSO in "oauth2/token" request (OAuth2TokenInitializer class). If it is not, we'll send it in "o/oauth2/programmatic_auth" request on step (5). 3) After NotifyUserLoggedIn() call, we store the device ID from the user context (if it is set) to local state. Then we start to create/load a profile for the user. 4) In constructor of ChromeSinginClient we migrate device id from kGoogleServicesSigninScopedDeviceId pref to the local state, if a value in the local state is empty. 5) We request tokens with "o/oauth2/programmatic_auth" if we haven't done that on step (2). Old code for sending device ID works here, because it relies on ChromeSigninClient which returns device ID set on step (4). BUG=486044,486136 Review URL: https://codereview.chromium.org/1138143002 Cr-Commit-Position: refs/heads/master@{#330207}
Diffstat (limited to 'components/user_manager')
-rw-r--r--components/user_manager/user_manager_base.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/components/user_manager/user_manager_base.cc b/components/user_manager/user_manager_base.cc
index 8b1feae..3e11ff8 100644
--- a/components/user_manager/user_manager_base.cc
+++ b/components/user_manager/user_manager_base.cc
@@ -1148,6 +1148,10 @@ bool UserManagerBase::FindGaiaID(const UserID& user_id,
void UserManagerBase::SetKnownUserDeviceId(const UserID& user_id,
const std::string& device_id) {
+ const std::string known_device_id = GetKnownUserDeviceId(user_id);
+ if (!known_device_id.empty() && device_id != known_device_id) {
+ NOTREACHED() << "Trying to change device ID for known user.";
+ }
SetKnownUserStringPref(user_id, kDeviceId, device_id);
}