• Hayato Ito's avatar
    Support basic access authentication through serviceworkers · ee6ca197
    Hayato Ito authored
    Authentication dialog is not shown when ServiceWorker returns 401 response.
    
    This CL addresses that in a similar manner as https://crrev.com/c/1290435 did,
    adding |window_id| on OnAuthRequired requests, however, unlike the client
    certificate case, we'll need even more plumbing for this bit because
    LoginHandlerDelegate needs to know whether a request is for the main frame or a
    subframe.
    
    This CL is effective only when Network Service is enabled. No behavior change
    on platforms where Network Service is disabled.
    
    Regarding the behavior of basic access auth login prompt, the prompt is always
    shown, regardless of any combination of mainframe/subframe and mainresource
    /subresource.
    
    In summary, the behavior of login prompt became as follows:
    
    |                        | TOT    | TOT (via SW) | With CL | With CL (via SW) |
    | mainframe-mainresource | prompt | no prompt    | prompt  | prompt           |
    | mainframe-subresource  | prompt | no prompt    | prompt  | prompt           |
    | subframe-mainresource  | prompt | no prompt    | prompt  | prompt           |
    | subframe-subresource   | prompt | no prompt    | prompt  | prompt           |
    
    Regarding tests, I confirmed that basic access authentication dialog is surely
    shown for main resources (and sub resources), using the repro case reported in
    the bug, manually, as well as adding a new browsertest for basic auth.
    
    This CL added new browsertest to service_worker_basic_tls_browsertest.cc,
    however, which is not renamed yet for easier reviewing. We'll rename in a
    follow-up CL.
    
    Bug: 623464,963748
    
    Change-Id: I01284b73b7af5de1e8a25112f2b06d50efe8dcc8
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614723Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
    Commit-Queue: Hayato Ito <hayato@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#665791}
    ee6ca197
shell_content_browser_client.h 6.36 KB