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

Issue 1097663003: Fetch OAuth2 tokens prior to profile creation. (Closed)

Created:
5 years, 8 months ago by achuithb
Modified:
5 years, 7 months ago
CC:
chromium-reviews, dzhioev+watch_chromium.org, stevenjb+watch_chromium.org, oshima+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

Fetch OAuth2 tokens prior to profile creation. BUG=470984 TEST= Committed: https://crrev.com/163a4a63af5e56801395eed067a69e501e7b51a5 Cr-Commit-Position: refs/heads/master@{#326691} Committed: https://crrev.com/09f1fa1af73e355514a2eb1594c4ba1f2e76acbd Cr-Commit-Position: refs/heads/master@{#326967}

Patch Set 1 #

Patch Set 2 : remove logging #

Total comments: 18

Patch Set 3 : Xiyuan feedback #

Patch Set 4 : RESTORE_FROM_PASSED_OAUTH2_ACCESS_TOKEN removed #

Patch Set 5 : rebase #

Patch Set 6 : set up default networks #

Total comments: 17

Patch Set 7 : Xiyuan/Nikita feedback #

Total comments: 10

Patch Set 8 : rebase #

Patch Set 9 : OAuth2TokenInitializer for non-SAML only #

Unified diffs Side-by-side diffs Delta from patch set Stats (+174 lines, -55 lines) Patch
M chrome/browser/chromeos/login/existing_user_controller.h View 1 2 3 chunks +6 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller.cc View 1 2 3 4 5 6 7 8 4 chunks +24 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/saml/saml_browsertest.cc View 1 2 3 4 5 6 7 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/session/user_session_manager.cc View 1 2 3 4 5 6 7 2 chunks +1 line, -3 lines 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_login_manager.h View 1 2 3 4 4 chunks +11 lines, -20 lines 0 comments Download
M chrome/browser/chromeos/login/signin/oauth2_login_manager.cc View 1 2 3 4 5 6 2 chunks +18 lines, -25 lines 0 comments Download
A chrome/browser/chromeos/login/signin/oauth2_token_initializer.h View 1 2 1 chunk +47 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chromeos/login/auth/user_context.h View 1 2 3 4 5 6 3 chunks +3 lines, -0 lines 0 comments Download
M chromeos/login/auth/user_context.cc View 1 2 3 4 5 6 4 chunks +14 lines, -6 lines 0 comments Download

Messages

Total messages: 69 (21 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/1097663003/1
5 years, 8 months ago (2015-04-20 19:37:41 UTC) #2
achuithb
Xiyuan, I'm fetching the tokens now before profile creation - let me know your thoughts?
5 years, 8 months ago (2015-04-20 19:43:39 UTC) #4
xiyuan
Thank you for taking care of the problem. I think it is the right thing ...
5 years, 8 months ago (2015-04-20 22:02:42 UTC) #5
achuithb
Xiyuan, Nikita: PTAL. https://codereview.chromium.org/1097663003/diff/20001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/20001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1127 chrome/browser/chromeos/login/existing_user_controller.cc:1127: UserSessionManager::GetInstance()->FetchOAuth2Tokens( On 2015/04/20 22:02:41, xiyuan wrote: ...
5 years, 8 months ago (2015-04-21 07:10:21 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/40001
5 years, 8 months ago (2015-04-21 07:10:46 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/48681)
5 years, 8 months ago (2015-04-21 09:04:20 UTC) #11
achuithb
I'm running into a problem with the PRE_NoSAML browsertest: https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/chromeos/login/saml/saml_browsertest.cc&l=985 This piece of code is ...
5 years, 8 months ago (2015-04-21 23:00:30 UTC) #12
xiyuan
For the default network problem, I wonder we could use the trick in OobeBaseTest::SimulateNetworkOnline [1]. ...
5 years, 8 months ago (2015-04-22 00:37:17 UTC) #13
achuithb
On 2015/04/22 00:37:17, xiyuan wrote: > For the default network problem, I wonder we could ...
5 years, 8 months ago (2015-04-22 22:58:04 UTC) #15
achuithb
PTAL, Xiyuan! https://codereview.chromium.org/1097663003/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/1097663003/diff/20001/chrome/browser/chromeos/login/session/user_session_manager.cc#newcode1250 chrome/browser/chromeos/login/session/user_session_manager.cc:1250: OAuth2LoginManager::RESTORE_FROM_PASSED_OAUTH2_ACCESS_TOKEN; On 2015/04/22 00:37:17, xiyuan wrote: > ...
5 years, 8 months ago (2015-04-22 22:58:14 UTC) #16
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/80001
5 years, 8 months ago (2015-04-22 23:00:52 UTC) #18
xiyuan
On 2015/04/22 22:58:04, achuithb wrote: > On 2015/04/22 00:37:17, xiyuan wrote: > > For the ...
5 years, 8 months ago (2015-04-22 23:06:36 UTC) #19
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_compile_dbg_32_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_compile_dbg_32_ng/builds/45553) ios_dbg_simulator_ninja on ...
5 years, 8 months ago (2015-04-22 23:13:38 UTC) #21
achuithb
On 2015/04/22 23:06:36, xiyuan wrote: > On 2015/04/22 22:58:04, achuithb wrote: > > On 2015/04/22 ...
5 years, 8 months ago (2015-04-22 23:21:04 UTC) #22
achuithb
Please excuse the rebase.
5 years, 8 months ago (2015-04-22 23:26:01 UTC) #24
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/100001
5 years, 8 months ago (2015-04-22 23:27:02 UTC) #25
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-23 00:47:33 UTC) #27
xiyuan
On 2015/04/22 23:21:04, achuithb wrote: > src/out/Debug/browser_tests --allow-file-access > --gtest_filter=SamlSuite/SAMLPolicyTest.PRE_NoSAML/1 --single_process > --user-data-dir=UserDataDir > > ...
5 years, 8 months ago (2015-04-23 00:51:21 UTC) #28
xiyuan
Mystery resolved. FakeShillManagerClient::SetupDefaultEnvironment is not called when DBusThreadManager::GetSetterForTesting to explicitly replace a service. SAMLPolicyTest uses ...
5 years, 8 months ago (2015-04-23 01:25:04 UTC) #29
achuithb
On 2015/04/23 01:25:04, xiyuan wrote: > Mystery resolved. > > FakeShillManagerClient::SetupDefaultEnvironment is not called when ...
5 years, 8 months ago (2015-04-23 09:31:26 UTC) #30
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/120001
5 years, 8 months ago (2015-04-23 09:31:53 UTC) #32
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-23 10:26:26 UTC) #34
Nikita (slow)
https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1127 chrome/browser/chromeos/login/existing_user_controller.cc:1127: user_context.GetAuthFlow() == UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML) { What happens for AUTH_FLOW_GAIA_WITH_SAML case? ...
5 years, 8 months ago (2015-04-23 10:59:25 UTC) #35
Nikita (slow)
lgtm https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc File chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc (right): https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc#newcode37 chrome/browser/chromeos/login/signin/oauth2_token_initializer.cc:37: LOG(WARNING) << "UserSessionManager::OnOAuth2TokensFetchFailed"; nit: Please update comment.
5 years, 8 months ago (2015-04-23 11:14:24 UTC) #36
xiyuan
LGTM with nits https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1127 chrome/browser/chromeos/login/existing_user_controller.cc:1127: user_context.GetAuthFlow() == UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML) { > What ...
5 years, 8 months ago (2015-04-23 16:09:23 UTC) #37
achuithb
Xiyuan, could you please make another pass through this CL? There were quite a few ...
5 years, 8 months ago (2015-04-23 22:11:16 UTC) #38
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/140001
5 years, 8 months ago (2015-04-23 22:12:14 UTC) #41
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-23 23:18:50 UTC) #43
xiyuan
SLGTM
5 years, 8 months ago (2015-04-23 23:28:31 UTC) #44
achuithb
On 2015/04/23 23:28:31, xiyuan wrote: > SLGTM Thanks for all the suggestions and feedback!
5 years, 8 months ago (2015-04-23 23:30:03 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/140001
5 years, 8 months ago (2015-04-23 23:31:12 UTC) #47
commit-bot: I haz the power
Committed patchset #7 (id:140001)
5 years, 8 months ago (2015-04-23 23:34:41 UTC) #48
commit-bot: I haz the power
Patchset 7 (id:??) landed as https://crrev.com/163a4a63af5e56801395eed067a69e501e7b51a5 Cr-Commit-Position: refs/heads/master@{#326691}
5 years, 8 months ago (2015-04-23 23:35:31 UTC) #49
horo
A revert of this CL (patchset #7 id:140001) has been created in https://codereview.chromium.org/1102863002/ by horo@chromium.org. ...
5 years, 8 months ago (2015-04-24 01:20:29 UTC) #50
xiyuan
https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/120001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1127 chrome/browser/chromeos/login/existing_user_controller.cc:1127: user_context.GetAuthFlow() == UserContext::AUTH_FLOW_GAIA_WITHOUT_SAML) { Oops. What Achuith had before ...
5 years, 8 months ago (2015-04-24 03:36:06 UTC) #51
Dmitry Polukhin
https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1217 chrome/browser/chromeos/login/existing_user_controller.cc:1217: OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); FYI, it causes DCHECK in https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/login/auth/auth_status_consumer.h&q=AuthFailure::AuthFailure&sq=package:chromium&type=cs&l=45 For some ...
5 years, 8 months ago (2015-04-24 12:51:08 UTC) #53
xiyuan
https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1217 chrome/browser/chromeos/login/existing_user_controller.cc:1217: OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); On 2015/04/24 12:51:08, Dmitry Polukhin wrote: > FYI, ...
5 years, 8 months ago (2015-04-24 13:54:43 UTC) #54
Dmitry Polukhin
https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1217 chrome/browser/chromeos/login/existing_user_controller.cc:1217: OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); On 2015/04/24 13:54:43, xiyuan wrote: > On 2015/04/24 ...
5 years, 8 months ago (2015-04-24 14:02:28 UTC) #55
xiyuan
https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1217 chrome/browser/chromeos/login/existing_user_controller.cc:1217: OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); On 2015/04/24 14:02:27, Dmitry Polukhin wrote: > On ...
5 years, 8 months ago (2015-04-24 15:49:38 UTC) #56
achuithb
PTAL, Xiyuan. Also, please advice on the best course for the token failure reporting issue. ...
5 years, 8 months ago (2015-04-25 00:53:32 UTC) #57
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/180001
5 years, 8 months ago (2015-04-25 00:54:44 UTC) #60
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 8 months ago (2015-04-25 02:44:37 UTC) #62
xiyuan
LGTM! https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc File chrome/browser/chromeos/login/existing_user_controller.cc (right): https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeos/login/existing_user_controller.cc#newcode1217 chrome/browser/chromeos/login/existing_user_controller.cc:1217: OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED)); On 2015/04/25 00:53:32, achuithb wrote: > On ...
5 years, 8 months ago (2015-04-25 03:25:09 UTC) #63
achuithb
On 2015/04/25 03:25:09, xiyuan wrote: > LGTM! Thank you!
5 years, 8 months ago (2015-04-25 11:02:31 UTC) #64
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1097663003/180001
5 years, 8 months ago (2015-04-25 11:02:50 UTC) #66
commit-bot: I haz the power
Committed patchset #9 (id:180001)
5 years, 8 months ago (2015-04-25 13:10:37 UTC) #67
commit-bot: I haz the power
Patchset 9 (id:??) landed as https://crrev.com/09f1fa1af73e355514a2eb1594c4ba1f2e76acbd Cr-Commit-Position: refs/heads/master@{#326967}
5 years, 8 months ago (2015-04-25 13:11:28 UTC) #68
Dmitry Polukhin
5 years, 7 months ago (2015-04-27 08:46:46 UTC) #69
Message was sent while issue was closed.
https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeo...
File chrome/browser/chromeos/login/existing_user_controller.cc (right):

https://codereview.chromium.org/1097663003/diff/140001/chrome/browser/chromeo...
chrome/browser/chromeos/login/existing_user_controller.cc:1217:
OnAuthFailure(AuthFailure(AuthFailure::NETWORK_AUTH_FAILED));
On 2015/04/25 03:25:09, xiyuan wrote:
> On 2015/04/25 00:53:32, achuithb wrote:
> > On 2015/04/24 15:49:38, xiyuan wrote:
> > > On 2015/04/24 14:02:27, Dmitry Polukhin wrote:
> > > > On 2015/04/24 13:54:43, xiyuan wrote:
> > > > > On 2015/04/24 12:51:08, Dmitry Polukhin wrote:
> > > > > > FYI, it causes DCHECK in
> > > > > >
> > > > >
> > > >
> > >
> >
>
https://code.google.com/p/chromium/codesearch#chromium/src/chromeos/login/aut...
> > > > > > 
> > > > > > For some test authentication failure is expected. Perhaps we have to
> > > remove
> > > > > that
> > > > > > check if now it is possible in some cases.
> > > > > 
> > > > > That DCHECK is probably meant to prevent setting NETWORK_AUTH_FAILED
> > without
> > > > > setting an error_.  I don't know how important the check is. Maybe set
a
> > > > default
> > > > > error if NETWORK_AUTH_FAILED is used and remove the DCHECK?
> > > > 
> > > > I'm not familiar with this AuthFailure code but my impression was the
> same.
> > I
> > > > tried to simple remove DCHECK but it won't help because code will crash
> > later
> > > > when will try to report error and LoginPerforme is missing. It seems
that
> > this
> > > > CL needs a bit more to handle failure token fetch errors. I'm working
> > > > BlockingLoginTest with this CL it almost passes it passes when all steps
> > > > succeed.
> > > 
> > > Maybe we should create a new AuthFailure reason (e.g.
> > > FAILED_TO_INITIALIZE_TOKEN) instead of NETWORK_AUTH_FAILED? Would that
still
> > hit
> > > the NULL LoginPerformer problem?
> > 
> > Is this a problem with a test in the current test suite (the tests are
passing
> > for me? Can we land this change and fix this in a follow-up?
> 
> I vote for landing this CL first and address the NETWORK_AUTH_FAILED issue in
a
> separate CL.

I'll take care of NETWORK_AUTH_FAILED. Tests that are failing are
BlockingLoginTest with enabled webview (in trunk they are disabled for webview).

Powered by Google App Engine
This is Rietveld 408576698