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

Issue 130963006: Reimplement inline signin with iframe (Closed)

Created:
6 years, 11 months ago by guohui
Modified:
6 years, 10 months ago
CC:
chromium-reviews, chromium-apps-reviews_chromium.org, arv+watch_chromium.org, extensions-reviews_chromium.org, Nikita (slow), bartfab (slow)
Visibility:
Public.

Description

Implement inline signin with iframe Inline signin chrome://chrome-signin is currently implemented using webview embedded in webUI, which breaks a couple of features in webUI and has serious accessbility issues. Since webview will be reimplemented based on OOPIF in the near future, and all the issues we have today will no longer apply, thus it is not worth the effort to fix them as they are throw away work. Instead, as suggested by John and prototyped in https://codereview.chromium.org/141363006/, we decide to switch to iframe instead. A few issues worth to mention, 1. The iframe shares the same renderer as the embedder webUI, and thus could be potentially exposed to dangerous webUI privileges. John suggested a fix by assigning a unique storage partition ID to the inline signin page. As a result the inline signin and its embedded web content should never share the same renderer with other webUI pages. 2. webview provides a direct API to inject script and to monitor requests/responses, which is not (directly) available with iframe. The CL works around the issue using content script and background script, quite similar to what CrOS is doing for SAML flow today. Thus it is also the first step towards unifying SAML flows on CrOS and desktop. 3. with webview approach, we used to have a unique temporary partition for each instance of inline signin, in order to make sure multiple instances do not interfere with each other. This is more difficult with the iframe approach, since the partition ID is hardcoded in a quite low layer. In this CL, all inline signin pages share the same persistent partition, which means we have to handle the case when user loads the sign in page with a dirty cookie jar, and thus the newly connected user may not be stored in the primary session. The CL solves the issue by reading 'session_index' from 'google-accounts-signin' header. COLLABORATOR=rogerta@chromium.org BUG=338127 R=jam@chromium.org, xiyuan@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252364

Patch Set 1 : #

Total comments: 18

Patch Set 2 : review comments addressed #

Patch Set 3 : enhance background.js to support multi-instances #

Total comments: 6

Patch Set 4 : patched roger's CL with bugs fixed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+510 lines, -353 lines) Patch
M chrome/browser/browser_resources.grd View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/chrome_content_browser_client.cc View 1 2 3 2 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/extensions/signin/gaia_auth_extension_loader.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc View 1 2 3 2 chunks +9 lines, -0 lines 0 comments Download
M chrome/browser/resources/component_extension_resources.grd View 1 2 3 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/resources/gaia_auth/background.js View 1 2 3 5 chunks +138 lines, -19 lines 0 comments Download
A + chrome/browser/resources/gaia_auth/desktop_injected.js View 1 2 3 2 chunks +6 lines, -15 lines 0 comments Download
D chrome/browser/resources/gaia_auth/inline_injected.js View 1 chunk +0 lines, -46 lines 0 comments Download
D chrome/browser/resources/gaia_auth/inline_main.html View 1 chunk +0 lines, -13 lines 0 comments Download
M chrome/browser/resources/gaia_auth/main.js View 1 2 3 7 chunks +90 lines, -121 lines 0 comments Download
A + chrome/browser/resources/gaia_auth/manifest_desktop.json View 1 2 3 2 chunks +3 lines, -9 lines 0 comments Download
D chrome/browser/resources/gaia_auth/manifest_inline.json View 1 chunk +0 lines, -32 lines 0 comments Download
M chrome/browser/resources/gaia_auth_host/gaia_auth_host.js View 1 2 3 9 chunks +10 lines, -57 lines 0 comments Download
M chrome/browser/resources/inline_login/inline_login.js View 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/ui/sync/one_click_signin_sync_starter.cc View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M chrome/browser/ui/webui/signin/inline_login_handler.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/ui/webui/signin/inline_login_handler_impl.h View 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/ui/webui/signin/inline_login_handler_impl.cc View 1 2 3 11 chunks +12 lines, -19 lines 0 comments Download
M chrome/browser/ui/webui/signin/inline_login_ui.cc View 1 2 3 3 chunks +4 lines, -1 line 0 comments Download
A chrome/browser/ui/webui/signin/inline_login_ui_browsertest.cc View 1 2 3 1 chunk +163 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/webui/url_data_manager_backend.cc View 1 2 3 4 chunks +53 lines, -8 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
guohui
Hey, could you please take a look at the CL? xiyuan and rogerta for chrome/browser/resources/... ...
6 years, 11 months ago (2014-01-25 22:11:22 UTC) #1
xiyuan
+nkostylev, bartfab fyi Can you also run linux_chromeos bot? I am interested to see how ...
6 years, 11 months ago (2014-01-26 01:59:57 UTC) #2
jam
Thanks for switching over quickly! On 2014/01/25 22:11:22, guohui wrote: > Hey, > > could ...
6 years, 11 months ago (2014-01-26 02:51:46 UTC) #3
jam
On 2014/01/26 02:51:46, jam wrote: > Thanks for switching over quickly! > > On 2014/01/25 ...
6 years, 11 months ago (2014-01-26 02:52:13 UTC) #4
guohui
On 2014/01/26 02:52:13, jam wrote: > On 2014/01/26 02:51:46, jam wrote: > > Thanks for ...
6 years, 11 months ago (2014-01-26 17:49:20 UTC) #5
xiyuan
On 2014/01/26 17:49:20, guohui wrote: > On 2014/01/26 02:52:13, jam wrote: > > On 2014/01/26 ...
6 years, 11 months ago (2014-01-26 18:17:34 UTC) #6
guohui1
The same issue should apply to cros in saml flows as well? I think we ...
6 years, 11 months ago (2014-01-26 19:14:48 UTC) #7
jam
On 2014/01/26 17:49:20, guohui wrote: > On 2014/01/26 02:52:13, jam wrote: > > On 2014/01/26 ...
6 years, 11 months ago (2014-01-27 16:49:29 UTC) #8
nasko
In general the code looks good, but I'd like to see tests for the security ...
6 years, 11 months ago (2014-01-27 17:21:50 UTC) #9
guohui
most review comments addressed, except for the unit test. Please let me know if anyone ...
6 years, 10 months ago (2014-01-29 12:50:51 UTC) #10
guohui
Fixed the multi-instance issue in patch 3. @nasko, could you please elaborate on what you ...
6 years, 10 months ago (2014-01-29 16:42:53 UTC) #11
guohui
https://codereview.chromium.org/130963006/diff/440001/chrome/browser/resources/gaia_auth/background.js File chrome/browser/resources/gaia_auth/background.js (right): https://codereview.chromium.org/130963006/diff/440001/chrome/browser/resources/gaia_auth/background.js#newcode134 chrome/browser/resources/gaia_auth/background.js:134: this.channelInjected_[this.getTabIdFromPort_(port)] = currentChannel; @xiyuan, it doesn't seem that channelInjected_ ...
6 years, 10 months ago (2014-01-29 16:49:34 UTC) #12
xiyuan
LGTM Please fix my comments and watch for no VM test failure on the cros_xxx ...
6 years, 10 months ago (2014-01-29 18:09:06 UTC) #13
guohui
Committed patchset #4 manually as r252364 (presubmit successful).
6 years, 10 months ago (2014-02-20 20:27:10 UTC) #14
guohui
6 years, 10 months ago (2014-02-20 20:47:48 UTC) #15
Message was sent while issue was closed.
For background on why we revive this old CL, please see 173723002.

https://codereview.chromium.org/130963006/diff/440001/chrome/browser/resource...
File chrome/browser/resources/gaia_auth/main.js (right):

https://codereview.chromium.org/130963006/diff/440001/chrome/browser/resource...
chrome/browser/resources/gaia_auth/main.js:159: 'email': opt_extraMsg.email ||
this.email_,
On 2014/01/29 18:09:07, xiyuan wrote:
> This would be a runtime error when |opt_extraMsg| is not passed.
> 
> 'email': (opt_extraMsg && opt_extraMsg.email) || this.email_,

Done.

https://codereview.chromium.org/130963006/diff/440001/chrome/browser/resource...
chrome/browser/resources/gaia_auth/main.js:162: 'chooseWhatToSync':
this.chooseWhatToSync_,
On 2014/01/29 18:09:07, xiyuan wrote:
> Set a default value for this.chooseWhatToSync_.
> Or use 'this.chooseWhatToSync_ || false'

Done.

Powered by Google App Engine
This is Rietveld 408576698