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

Issue 1138143002: Pass Device ID in the oauth2/token request. Keep Device ID in local state on Chrome OS. (Closed)

Created:
5 years, 7 months ago by dzhioev (left Google)
Modified:
5 years, 7 months ago
CC:
chromium-reviews, nkostylev+watch_chromium.org, dzhioev+watch_chromium.org, arv+watch_chromium.org, oshima+watch_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

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 Committed: https://crrev.com/a912deca5f760681835e4247225c1c83b656d0b5 Cr-Commit-Position: refs/heads/master@{#330207}

Patch Set 1 #

Patch Set 2 : Final version. #

Total comments: 30

Patch Set 3 : Comments addressed. #

Total comments: 8

Patch Set 4 : Pavel's comments addressed. #

Patch Set 5 : Xiyuan comments. #

Total comments: 4

Patch Set 6 : Added comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -214 lines) Patch
M chrome/browser/chromeos/login/existing_user_controller.cc View 1 2 3 4 2 chunks +15 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/session/user_session_manager.cc View 1 2 3 4 2 chunks +6 lines, -14 lines 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_token_fetcher.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_token_fetcher.cc View 1 3 chunks +16 lines, -16 lines 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc View 1 1 chunk +4 lines, -1 line 0 comments Download
M chrome/browser/resources/chromeos/login/screen_gaia_signin.js View 1 2 3 4 5 chunks +2 lines, -28 lines 0 comments Download
M chrome/browser/resources/gaia_auth_host/authenticator.js View 9 chunks +1 line, -81 lines 0 comments Download
M chrome/browser/signin/chrome_signin_client.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/browser/signin/chrome_signin_client.cc View 1 2 3 4 5 5 chunks +57 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h View 1 2 4 chunks +1 line, -14 lines 0 comments Download
M chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc View 1 2 9 chunks +2 lines, -47 lines 0 comments Download
M chromeos/login/auth/user_context.cc View 1 chunk +2 lines, -1 line 0 comments Download
M components/user_manager/user_manager_base.cc View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M google_apis/gaia/gaia_auth_fetcher.h View 3 chunks +17 lines, -2 lines 0 comments Download
M google_apis/gaia/gaia_auth_fetcher.cc View 1 2 4 chunks +21 lines, -7 lines 0 comments Download

Messages

Total messages: 39 (13 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138143002/1
5 years, 7 months ago (2015-05-12 06:11:51 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-12 07:57:33 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138143002/20001
5 years, 7 months ago (2015-05-12 22:10:51 UTC) #6
dzhioev (left Google)
Hello, PTAL. Tests to follow, I'm working on them.
5 years, 7 months ago (2015-05-12 22:48:56 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 7 months ago (2015-05-12 22:57:42 UTC) #10
achuithb
Where does step 5 happen?"o/oauth2/programmatic_auth" part. Most of the following are just nits. I'm only ...
5 years, 7 months ago (2015-05-12 23:25:02 UTC) #12
pavely
https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode427 chrome/browser/chromeos/login/session/user_session_manager.cc:427: if (!user_context_.GetDeviceId().empty()) nit: Consider using user_context instead of user_context_? ...
5 years, 7 months ago (2015-05-13 00:05:52 UTC) #13
dzhioev (left Google)
Step 5 happens when we follow regular non-auth_code authentication path. See OAuth2LoginManager::FetchOAuth2Tokens() https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/chromeos/login/signin/oauth2_login_manager.cc&q=chrome/browser/chromeos/login/signin/oauth2_login_manager.cc&sq=package:chromium&type=cs&l=229 https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/chromeos/login/existing_user_controller.cc File ...
5 years, 7 months ago (2015-05-13 00:25:18 UTC) #14
xiyuan
LGTM with nits Please wait for other reviewers to sign off as well. https://codereview.chromium.org/1138143002/diff/40001/chrome/browser/chromeos/login/session/user_session_manager.cc File ...
5 years, 7 months ago (2015-05-13 01:18:02 UTC) #15
dzhioev (left Google)
https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode427 chrome/browser/chromeos/login/session/user_session_manager.cc:427: if (!user_context_.GetDeviceId().empty()) On 2015/05/13 00:05:52, pavely wrote: > nit: ...
5 years, 7 months ago (2015-05-13 20:24:22 UTC) #16
pavely
lgtm
5 years, 7 months ago (2015-05-13 22:05:33 UTC) #17
Nikita (slow)
https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/signin/chrome_signin_client.cc File chrome/browser/signin/chrome_signin_client.cc (right): https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/signin/chrome_signin_client.cc#newcode69 chrome/browser/signin/chrome_signin_client.cc:69: } On 2015/05/13 20:24:22, dzhioev wrote: > On 2015/05/13 ...
5 years, 7 months ago (2015-05-14 06:29:03 UTC) #19
Nikita (slow)
https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/signin/chrome_signin_client.cc File chrome/browser/signin/chrome_signin_client.cc (right): https://codereview.chromium.org/1138143002/diff/20001/chrome/browser/signin/chrome_signin_client.cc#newcode69 chrome/browser/signin/chrome_signin_client.cc:69: } On 2015/05/14 06:29:03, Nikita wrote: > On 2015/05/13 ...
5 years, 7 months ago (2015-05-14 06:34:14 UTC) #20
dzhioev (left Google)
https://codereview.chromium.org/1138143002/diff/40001/chrome/browser/chromeos/login/session/user_session_manager.cc File chrome/browser/chromeos/login/session/user_session_manager.cc (right): https://codereview.chromium.org/1138143002/diff/40001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode427 chrome/browser/chromeos/login/session/user_session_manager.cc:427: if (!user_context_.GetDeviceId().empty()) On 2015/05/13 01:18:02, xiyuan wrote: > nit: ...
5 years, 7 months ago (2015-05-14 23:50:52 UTC) #21
dzhioev (left Google)
Achuith, do you have more to say? I'm still working on tests. They happened to ...
5 years, 7 months ago (2015-05-14 23:54:59 UTC) #22
achuithb
On 2015/05/14 23:54:59, dzhioev wrote: > Achuith, do you have more to say? > > ...
5 years, 7 months ago (2015-05-14 23:55:51 UTC) #23
dzhioev (left Google)
I realized that this CL is still missing OWNERS LGTM for google_apis/gaia/gaia_auth_fetcher.* and chrome/browser/signin/chrome_signin_client.*. Roger, ...
5 years, 7 months ago (2015-05-15 00:00:25 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138143002/80001
5 years, 7 months ago (2015-05-15 03:53:04 UTC) #28
dzhioev (left Google)
FYI: here is a CL with tests https://codereview.chromium.org/1141163002/
5 years, 7 months ago (2015-05-15 04:56:17 UTC) #29
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_x64_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/57845)
5 years, 7 months ago (2015-05-15 06:21:15 UTC) #31
Roger Tawa OOO till Jul 10th
Looks pretty much OK, but this code is cros specific when it should also support ...
5 years, 7 months ago (2015-05-15 13:50:24 UTC) #32
Roger Tawa OOO till Jul 10th
On 2015/05/15 13:50:24, Roger Tawa wrote: > Looks pretty much OK, but this code is ...
5 years, 7 months ago (2015-05-15 16:39:12 UTC) #33
dzhioev (left Google)
Thanks everybody https://codereview.chromium.org/1138143002/diff/80001/chrome/browser/signin/chrome_signin_client.cc File chrome/browser/signin/chrome_signin_client.cc (right): https://codereview.chromium.org/1138143002/diff/80001/chrome/browser/signin/chrome_signin_client.cc#newcode112 chrome/browser/signin/chrome_signin_client.cc:112: std::string ChromeSigninClient::GenerateSigninScopedDeviceID( On 2015/05/15 13:50:23, Roger Tawa ...
5 years, 7 months ago (2015-05-15 20:05:39 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1138143002/100001
5 years, 7 months ago (2015-05-15 20:07:35 UTC) #37
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 7 months ago (2015-05-15 21:53:27 UTC) #38
commit-bot: I haz the power
5 years, 7 months ago (2015-05-18 11:28:00 UTC) #39
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/a912deca5f760681835e4247225c1c83b656d0b5
Cr-Commit-Position: refs/heads/master@{#330207}

Powered by Google App Engine
This is Rietveld 408576698