Title: [295068] trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm
- Revision
- 295068
- Author
- [email protected]
- Date
- 2022-05-31 15:08:23 -0700 (Tue, 31 May 2022)
Log Message
PopUpSOAuthorization::initSecretWebView modifies parent web view configuration
https://bugs.webkit.org/show_bug.cgi?id=241155
<rdar://94176551>
Reviewed by Chris Dumez.
The AppSSO flows that create a new WKWebView pass through the method
'PopUpSOAuthorizationSession::initSecretWebView'. This conducts SSO flows in
an invisible Window for cases where other UI handles the actual authentication,
but a web view is needed to handle server interactions. It deactivates AppSSO
in the hidden view so that normal server authentication can happen without AppSSO
being triggered a second time.
This method made the common mistake of assuming that performing 'copy' on the
configuration member of the paren't WKWebView yielded a deep copy that could bei
manipulated to control the invisible view independently of the parent view. While
the method correctly disabled AppSSO for the hidden view, it also deactivated it
for the parent view.
This bug could lead to cases where someone who mistakenly terminated an AppSSO flow
would be unable to start the process a second time, as the view would now be
configured to block access to AppSSO authentication.
This patch corrects that bug.
Tested by SOAuthorizationPopUp.InterceptionSucceedTwice.
* Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm:
(WebKit::PopUpSOAuthorizationSession::initSecretWebView):
Canonical link: https://commits.webkit.org/251163@main
Modified Paths
Diff
Modified: trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm (295067 => 295068)
--- trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm 2022-05-31 21:47:39 UTC (rev 295067)
+++ trunk/Source/WebKit/UIProcess/Cocoa/SOAuthorization/PopUpSOAuthorizationSession.mm 2022-05-31 22:08:23 UTC (rev 295068)
@@ -184,7 +184,9 @@
return;
auto configuration = adoptNS([[initiatorWebView configuration] copy]);
[configuration _setRelatedWebView:initiatorWebView.get()];
- [configuration preferences]._extensibleSSOEnabled = NO;
+ auto secretViewPreferences = adoptNS([[configuration preferences] copy]);
+ [secretViewPreferences _setExtensibleSSOEnabled:NO];
+ [configuration setPreferences:secretViewPreferences.get()];
m_secretWebView = adoptNS([[WKWebView alloc] initWithFrame:CGRectZero configuration:configuration.get()]);
m_secretDelegate = adoptNS([[WKSOSecretDelegate alloc] initWithSession:this]);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes