[webview_flutter] Support for handling basic authentication requests#4140
[webview_flutter] Support for handling basic authentication requests#4140andreisas06 wants to merge 31 commits intoflutter:mainfrom
Conversation
9f79b3b to
38311df
Compare
|
@bparrishMines should I proceed with the PR containing only the platform interface package? |
bparrishMines
left a comment
There was a problem hiding this comment.
This also needs an implementation for webview_flutter_wkwebview. Using https://developer.apple.com/documentation/webkit/wknavigationdelegate/3601237-webview?language=objc I believe.
There was a problem hiding this comment.
nit:
| /// Signature for callbacks that report basic auth events by the native web view | |
| /// Signature for callbacks that report basic auth events by the native web view. |
There was a problem hiding this comment.
nit:
| /// Sets the auth credentials for basic authentication and can be used on onReceiveHttpAuthRequest with NavigationDelegate. | |
| /// Sets the auth credentials for basic authentication and can be used with | |
| /// [PlatformNavigationDelegate.onReceiveHttpAuthRequest]. |
There was a problem hiding this comment.
The FlutterAPI should pass back the HttpAuthHandler instead of adding a setAuthCredentials method. Mainly because the HttpAuthHandler has multiple methods that could be used. e.g. cancel and useHttpAuthUsernamePassword.
|
Hey @bparrishMines , @JeroenWeener will be taking over for the IOS implementation of this PR. |
38311df to
3fb8d80
Compare
There was a problem hiding this comment.
When there is an error, don't we also need to call completionHandler in production?
|
Hi @stuartmorgan, This PR is ready for review, we are keeping it up to date until then. |
stuartmorgan-g
left a comment
There was a problem hiding this comment.
I didn't review the implementations, but I'm happy with the overall structure. Once @bparrishMines has done another full review of the PR it should be ready to break up.
| if (WebViewPlatform.instance is WebKitWebViewPlatform) { | ||
| params = WebKitWebViewControllerCreationParams( | ||
| allowsInlineMediaPlayback: true, | ||
| mediaTypesRequiringUserAction: const <PlaybackMediaTypes>{}, |
There was a problem hiding this comment.
Bad merge, or was this intentionally removed?
| /// The callback to proceed with, or cancel an auth request. | ||
| /// | ||
| /// If `credential` is `null`, the request will be canceled. | ||
| final void Function(WebViewCredential? credential) onAuthenticate; |
There was a problem hiding this comment.
I think the outcome of #4140 (comment) was that we were going to go back to onProceed and onCancel? I'll defer to @bparrishMines on the exact callback structure though.
There was a problem hiding this comment.
Correct. I think we should separate this into onCancel and onProceed again. And then iOS can add its additional method.
…b/src/types/http_auth_request.dart
…s into webview-auth-request
|
I went ahead and added the changes mentioned in #4140 (comment) and updated the PR with the pigeon upgrade from #5271 |
bparrishMines
left a comment
There was a problem hiding this comment.
LGTM
I think this is ready to be split into separate PRs. @andreisas06 @mvanbeusekom let me know if you would like to do this or have me finish this part.
|
Hi @bparrishMines, thank you for the changes and the review. Could you tell me how you usually deal with splitting PRs? I find myself a bit lost when trying to separate the platform interface changes from the other changes. |
FWIW my workflow is:
That should given you a branch that is exactly the platform interface subset of this PR. (I prefer this to trying to apply a patch file to a new clean branch because I find that more error-prone.) |
|
Thanks @stuartmorgan, learned something new today 👍 |
|
@bparrishMines the platform interface PR is up! You can find it here: #5362. |
|
Thank @stuartmorgan and @bparrishMines for merging the related PRs. The final PR that exposes the iOS and Android implementations can be found here: #5727. @andreisas06 could you close this PR? |
|
@bparrishMines and @stuartmorgan can this be closed in favor of #5727 (review) and friends? Seems like this is zombied. |
Description
This pull request introduces the handling of HTTP Basic Authentication in our WebView implementation. Specifically, it includes the following changes:
Issues fixed by PR:
Closes flutter/flutter#83556
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change, [following repository CHANGELOG style].///).