Still can't login to my.playstation.com
authorkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2020 23:14:20 +0000 (23:14 +0000)
committerkatherine_cheney@apple.com <katherine_cheney@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Dec 2020 23:14:20 +0000 (23:14 +0000)
commit85f4e6119d8ca29e97ad3d1e3aede6c7e4fa4a3d
tree809037cf3f280a47822d8622338213587637dba7
parentc43185916a84643c65acd12feb3d7a003066a459
Still can't login to my.playstation.com
https://bugs.webkit.org/show_bug.cgi?id=219900
<rdar://problem/72062985>

Reviewed by John Wilander.

Adapted from an original patch by John Wilander.

This is a temporary quirk to assist a high-traffic website while they
complete the large task of migrating away from login flows that
require third party cookies. This quirk will be removed when the site
is updated.

Source/WebCore:

Create a quirk to call the Storage Access API on behalf of Sony. This
case is unique because playstation.com requires storage access for 2
login domains: sony.com and sonyentertainmentnetwork.com. This patch
handles this by requesting storage access for both domains if either
domain is requested to avoid massive changes to the Storage Access
code to handle multiple domains at once.

This patch adjusts the quirk code in NetworkStorageSession to handle
multiple login domains for a single first party domain.

No new tests, site specific quirk.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
* page/Quirks.cpp:
(WebCore::isPlaystationLoginElement):
(WebCore::Quirks::hasStorageAccessForAllLoginDomains):
(WebCore::Quirks::triggerOptionalStorageAccessQuirk const):
Adjust the existing quirks to handle the new format of a HashSet of
login domains, and add the new playstation.com case.

* page/Quirks.h:
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::grantCrossPageStorageAccess):
(WebCore::NetworkStorageSession::hasStorageAccess const):
(WebCore::NetworkStorageSession::storageAccessQuirks):
(WebCore::NetworkStorageSession::loginDomainMatchesRequestingDomain):
(WebCore::NetworkStorageSession::loginDomainsForFirstParty):
(WebCore::NetworkStorageSession::findAdditionalLoginDomain):
Function to match up Sony login domains with one another at storage
endpoints and for prompting so we don't need to thread them through
all of the existing storage access code.

(WebCore::NetworkStorageSession::loginDomainForFirstParty): Renamed to be plural.
* platform/network/NetworkStorageSession.h:
Adjusted existing quirk code to handle a HashSet of login domains
instead of a single domain.

Source/WebKit:

Create a quirk to call the Storage Access API on behalf of Sony.

* UIProcess/Cocoa/UIDelegate.mm:
(WebKit::buildList):
(WebKit::UIDelegate::UIClient::requestStorageAccessConfirm):
* UIProcess/Cocoa/WKStorageAccessAlert.mm:
(WebKit::presentStorageAccessAlert):
Prompt for multiple domains if site-specific quirks are enabled and
either Sony login domain is being requested.

* WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp:
(WebKit::WebResourceLoadObserver::hasCrossPageStorageAccess const):
(WebKit::WebResourceLoadObserver::setDomainsWithCrossPageStorageAccess):
* WebProcess/WebCoreSupport/WebResourceLoadObserver.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addDomainWithPageLevelStorageAccess):
Store both Sony login domains as having page level storage access if
quirks are enabled and the domain passed is one of the Sony login
domains. In this case we know that both login domains were prompted
for.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270912 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/loader/DocumentLoader.cpp
Source/WebCore/page/Quirks.cpp
Source/WebCore/page/Quirks.h
Source/WebCore/platform/network/NetworkStorageSession.cpp
Source/WebCore/platform/network/NetworkStorageSession.h
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
Source/WebKit/UIProcess/Cocoa/WKStorageAccessAlert.h
Source/WebKit/UIProcess/Cocoa/WKStorageAccessAlert.mm
Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.cpp
Source/WebKit/WebProcess/WebCoreSupport/WebResourceLoadObserver.h
Source/WebKit/WebProcess/WebPage/WebPage.cpp