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

Issue 11649055: OAuth2 sign-in flow for ChromeOS (Closed)

Created:
8 years ago by zel
Modified:
7 years, 11 months ago
CC:
chromium-reviews, oshima+watch_chromium.org, stevenjb+watch_chromium.org, nkostylev+watch_chromium.org, davemoore+watch_chromium.org
Visibility:
Public.

Description

OAuth2 sign-in flow for ChromeOS. Refactored all OAuth1/2 code out of LoginUtils into OAuthLoginManager class. Created OAuth2-based specialization of OAuthLoginManager (behind --force-oauth2 switch). This new class uses OAuth2 refresh tokens as a base token from which all others are minted - incl. GAIA credentials and session cookies. BUG=166192, 169999 TEST=existing unit, browser tests, additional manual testing TBR=sky Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176800

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : wired OAuth2 stack #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : #

Total comments: 42

Patch Set 9 : review updates #

Patch Set 10 : #

Patch Set 11 : #

Total comments: 2

Patch Set 12 : #

Patch Set 13 : #

Patch Set 14 : wired policy with OAuth2 path #

Total comments: 130

Patch Set 15 : Joao's comments #

Patch Set 16 : #

Total comments: 8

Patch Set 17 : #

Patch Set 18 : #

Total comments: 37

Patch Set 19 : ~ #

Patch Set 20 : nikita's comments #

Patch Set 21 : #

Patch Set 22 : #

Patch Set 23 : OAuth2 flow fixes #

Patch Set 24 : rebase #

Patch Set 25 : rebase #

Patch Set 26 : clang fixes #

Patch Set 27 : rebase #

Patch Set 28 : clang fixes #

Patch Set 29 : clang fix #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+1939 lines, -858 lines) Patch
M chrome/app/generated_resources.grd View 1 chunk +6 lines, -0 lines 0 comments Download
M chrome/browser/about_flags.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +7 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/chrome_browser_main_chromeos.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/cros/cert_library.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -0 lines 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/existing_user_controller_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/login_performer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/login/login_performer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 4 chunks +14 lines, -64 lines 0 comments Download
M chrome/browser/chromeos/login/login_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 3 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/chromeos/login/login_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 17 chunks +47 lines, -284 lines 0 comments Download
M chrome/browser/chromeos/login/login_utils_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/mock_login_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -5 lines 0 comments Download
A chrome/browser/chromeos/login/oauth1_login_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +80 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth1_login_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +223 lines, -0 lines 0 comments Download
A + chrome/browser/chromeos/login/oauth1_login_verifier.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +25 lines, -23 lines 0 comments Download
A + chrome/browser/chromeos/login/oauth1_login_verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 9 chunks +38 lines, -40 lines 0 comments Download
M chrome/browser/chromeos/login/oauth1_token_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 3 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/oauth1_token_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +11 lines, -14 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_login_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +111 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_login_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +245 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_login_verifier.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 chunk +121 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_login_verifier.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +246 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_policy_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +110 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_policy_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +155 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_token_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +68 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth2_token_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +101 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth_login_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +101 lines, -0 lines 0 comments Download
A chrome/browser/chromeos/login/oauth_login_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 1 chunk +48 lines, -0 lines 0 comments Download
D chrome/browser/chromeos/login/oauth_login_verifier.h View 1 2 1 chunk +0 lines, -106 lines 0 comments Download
D chrome/browser/chromeos/login/oauth_login_verifier.cc View 1 2 1 chunk +0 lines, -206 lines 0 comments Download
M chrome/browser/chromeos/login/online_attempt.cc View 1 2 3 4 5 6 7 8 9 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/chromeos/login/parallel_authenticator.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +6 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/login/policy_oauth_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +5 lines, -3 lines 0 comments Download
M chrome/browser/chromeos/login/policy_oauth_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +8 lines, -8 lines 0 comments Download
M chrome/browser/chromeos/login/profile_auth_data.h View 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/chromeos/login/profile_auth_data.cc View 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/chromeos/login/test_login_utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 2 chunks +0 lines, -7 lines 0 comments Download
M chrome/browser/chromeos/login/test_login_utils.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/chromeos/login/user.h View 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/chromeos/login/user_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +13 lines, -18 lines 0 comments Download
M chrome/browser/chromeos/preferences.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +9 lines, -7 lines 0 comments Download
M chrome/browser/resources/chromeos/login/user_pod_row.js View 1 2 3 chunks +7 lines, -4 lines 0 comments Download
M chrome/browser/signin/signin_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 2 chunks +7 lines, -1 line 1 comment Download
M chrome/browser/signin/token_service.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +6 lines, -2 lines 0 comments Download
M chrome/browser/signin/token_service.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +20 lines, -6 lines 0 comments Download
M chrome/chrome_browser_chromeos.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1 chunk +14 lines, -2 lines 0 comments Download
M chrome/common/chrome_switches.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/chrome_switches.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 chunks +4 lines, -3 lines 0 comments Download
M google_apis/gaia/gaia_auth_fetcher.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 4 chunks +20 lines, -2 lines 0 comments Download
M google_apis/gaia/gaia_auth_fetcher.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 7 chunks +24 lines, -5 lines 0 comments Download

Messages

Total messages: 17 (0 generated)
zel
7 years, 11 months ago (2012-12-29 01:20:11 UTC) #1
zel
7 years, 11 months ago (2013-01-03 06:41:36 UTC) #2
xiyuan
https://codereview.chromium.org/11649055/diff/17001/chrome/browser/chromeos/login/login_manager.cc File chrome/browser/chromeos/login/login_manager.cc (right): https://codereview.chromium.org/11649055/diff/17001/chrome/browser/chromeos/login/login_manager.cc#newcode3 chrome/browser/chromeos/login/login_manager.cc:3: // found in the LICENSE file. nit: insert an ...
7 years, 11 months ago (2013-01-07 23:07:55 UTC) #3
zel
https://codereview.chromium.org/11649055/diff/17001/chrome/browser/chromeos/login/login_manager.cc File chrome/browser/chromeos/login/login_manager.cc (right): https://codereview.chromium.org/11649055/diff/17001/chrome/browser/chromeos/login/login_manager.cc#newcode3 chrome/browser/chromeos/login/login_manager.cc:3: // found in the LICENSE file. On 2013/01/07 23:07:55, ...
7 years, 11 months ago (2013-01-08 02:05:41 UTC) #4
xiyuan
LGTM https://codereview.chromium.org/11649055/diff/19002/chrome/browser/chromeos/login/oauth_login_manager.cc File chrome/browser/chromeos/login/oauth_login_manager.cc (right): https://codereview.chromium.org/11649055/diff/19002/chrome/browser/chromeos/login/oauth_login_manager.cc#newcode54 chrome/browser/chromeos/login/oauth_login_manager.cc:54: TokenService* OAuthLoginManager::SetupTokenService() { Could SetupTokenService be called multiple ...
7 years, 11 months ago (2013-01-08 17:41:43 UTC) #5
zel
https://codereview.chromium.org/11649055/diff/19002/chrome/browser/chromeos/login/oauth_login_manager.cc File chrome/browser/chromeos/login/oauth_login_manager.cc (right): https://codereview.chromium.org/11649055/diff/19002/chrome/browser/chromeos/login/oauth_login_manager.cc#newcode54 chrome/browser/chromeos/login/oauth_login_manager.cc:54: TokenService* OAuthLoginManager::SetupTokenService() { On 2013/01/08 17:41:43, xiyuan wrote: > ...
7 years, 11 months ago (2013-01-11 02:42:59 UTC) #6
zel
+joaodasilva, pastarmovj ...adding enterprise people to take a peek at policy token fetching part.
7 years, 11 months ago (2013-01-11 02:53:27 UTC) #7
pastarmovj
I don't see issues with the policy fetching code but i will leave it to ...
7 years, 11 months ago (2013-01-11 09:42:04 UTC) #8
Joao da Silva
Lots of nits mixed within more relevant comments. The policy paths for oauth1 should be ...
7 years, 11 months ago (2013-01-11 16:45:07 UTC) #9
zel
https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc File chrome/browser/chromeos/cros/cert_library.cc (right): https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc#newcode200 chrome/browser/chromeos/cros/cert_library.cc:200: #ifndef NDEBUG On 2013/01/11 16:45:07, Joao da Silva wrote: ...
7 years, 11 months ago (2013-01-11 19:51:16 UTC) #10
Joao da Silva
lgtm Thanks for the explanations in the comments! https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc File chrome/browser/chromeos/cros/cert_library.cc (right): https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc#newcode200 chrome/browser/chromeos/cros/cert_library.cc:200: #ifndef ...
7 years, 11 months ago (2013-01-11 20:13:15 UTC) #11
zel
https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc File chrome/browser/chromeos/cros/cert_library.cc (right): https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/cros/cert_library.cc#newcode200 chrome/browser/chromeos/cros/cert_library.cc:200: #ifndef NDEBUG On 2013/01/11 20:13:15, Joao da Silva wrote: ...
7 years, 11 months ago (2013-01-11 20:54:20 UTC) #12
zel
+rogerta for TokenService and friends
7 years, 11 months ago (2013-01-11 21:41:25 UTC) #13
Nikita (slow)
https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/login/login_performer.cc File chrome/browser/chromeos/login/login_performer.cc (right): https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/login/login_performer.cc#newcode191 chrome/browser/chromeos/login/login_performer.cc:191: LoginUtils::Get()->StartTokenServices(profile); On 2013/01/11 19:51:16, zel wrote: > On 2013/01/11 ...
7 years, 11 months ago (2013-01-11 22:02:02 UTC) #14
Nikita (slow)
lgtm mostly nits https://codereview.chromium.org/11649055/diff/66001/chrome/browser/chromeos/login/oauth2_login_verifier.cc File chrome/browser/chromeos/login/oauth2_login_verifier.cc (right): https://codereview.chromium.org/11649055/diff/66001/chrome/browser/chromeos/login/oauth2_login_verifier.cc#newcode105 chrome/browser/chromeos/login/oauth2_login_verifier.cc:105: LOG(WARNING) << "OAuthLogin successful!"; VLOG(1). You ...
7 years, 11 months ago (2013-01-11 22:57:39 UTC) #15
zel
https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/login/login_performer.cc File chrome/browser/chromeos/login/login_performer.cc (right): https://codereview.chromium.org/11649055/diff/41001/chrome/browser/chromeos/login/login_performer.cc#newcode191 chrome/browser/chromeos/login/login_performer.cc:191: LoginUtils::Get()->StartTokenServices(profile); On 2013/01/11 22:02:03, Nikita Kostylev wrote: > On ...
7 years, 11 months ago (2013-01-12 02:07:36 UTC) #16
tim (not reviewing)
7 years, 11 months ago (2013-01-15 02:36:34 UTC) #17
browser/signin LGTM, although had a few comments / suggestions if you're (or
anyone!) is planning on continuing to refactor cros login code.

https://codereview.chromium.org/11649055/diff/75001/chrome/browser/signin/sig...
File chrome/browser/signin/signin_manager.cc (right):

https://codereview.chromium.org/11649055/diff/75001/chrome/browser/signin/sig...
chrome/browser/signin/signin_manager.cc:137: #if !defined(OS_CHROMEOS)
fwiw, we've been trying to get rid of ifdefs like this in this code due to the
subtle behavior differences / bugs that have cropped up, and test
cumbersomeness, but I suppose there's no way around it at the moment.  

It'd be nice if we could factor out the cros specificness into a separate class
or delegate some day, so TokenService & SigninManager (and in general, "the code
responsible for getting auth tokens") are less fragmented.

It'd also be nice to hook things up to about:signin.  We had an intern working
on parts of this for Chrome OS, although the patch never did land
(https://codereview.chromium.org/11618024/)

Powered by Google App Engine
This is Rietveld 408576698