You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cb53af0
Browse filesBrowse the repository at this point in the historyBrowse files
[webview_flutter_android] Set support for web authentication (#11681)
This PR adds Android support for configuring WebView web authentication behavior through WebSettingsCompat.setWebAuthenticationSupport.
- Added a new Pigeon API for WebSettingsCompat.setWebAuthenticationSupport.
- Implemented the Android host-side proxy in WebSettingsCompatProxyApi.
- Wired the generated Android and Dart Pigeon bindings to expose the new method.
- Updated the Android controller flow to call the new API when the corresponding feature is supported.
- Added/updated constants and example/docs to reflect the new support.
- Added focused tests for the new Android host-side behavior.
https://github.com/user-attachments/assets/cb0b1cfa-7a79-47c3-ad1b-d5230ce42b1d
*List which issues are fixed by this PR. You must list at least one issue.*
flutter/flutter#186312
## Pre-Review Checklist
**Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.
[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
Copy file name to clipboardExpand all lines: packages/webview_flutter/webview_flutter_android/CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,6 @@
1
+
## 4.14.0
2
+
* Adds support for configuring Web Authentication in `AndroidWebViewController` with `setWebAuthenticationSupport` to enable Passkey and other related Authentication.
3
+
1
4
## 4.13.0
2
5
3
6
* Adds new method for accessing a native `WebView` from a `FlutterPluginBinding`.
Copy file name to clipboardExpand all lines: packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/AndroidWebkitLibrary.g.kt
+26Lines changed: 26 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6826,6 +6826,8 @@ abstract class PigeonApiWebSettingsCompat(
Copy file name to clipboardExpand all lines: packages/webview_flutter/webview_flutter_android/android/src/main/java/io/flutter/plugins/webviewflutter/WebSettingsCompatProxyApi.java
+24Lines changed: 24 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -29,4 +29,28 @@ public WebSettingsCompatProxyApi(@NonNull ProxyApiRegistrar pigeonRegistrar) {
Copy file name to clipboardExpand all lines: packages/webview_flutter/webview_flutter_android/android/src/test/java/io/flutter/plugins/webviewflutter/WebSettingsCompatTest.java
+35Lines changed: 35 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
packageio.flutter.plugins.webviewflutter;
6
6
7
+
importstaticorg.junit.Assert.assertThrows;
7
8
importstaticorg.junit.Assert.fail;
8
9
importstaticorg.mockito.Mockito.mock;
9
10
importstaticorg.mockito.Mockito.mockStatic;
@@ -36,4 +37,38 @@ public void setPaymentRequestEnabled() {
Copy file name to clipboardExpand all lines: packages/webview_flutter/webview_flutter_android/lib/src/android_webkit_constants.dart
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -126,4 +126,9 @@ class WebViewFeatureConstants {
126
126
///
127
127
/// See https://developer.android.com/reference/androidx/webkit/WebViewFeature#PAYMENT_REQUEST.
/// This feature covers [WebSettingsCompat.setWebAuthenticationSupport].
131
+
///
132
+
/// See https://developer.android.com/reference/androidx/webkit/WebViewFeature#WEB_AUTHENTICATION.
/// See https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setWebAuthenticationSupport.
/// Sets whether the WebView should enable the Payment Request API.
798
830
///
799
831
/// This method uses [android_webview.WebSettingsCompat.setPaymentRequestEnabled]
@@ -960,6 +992,41 @@ enum WebViewFeatureType {
960
992
///
961
993
/// This feature covers [WebSettingsCompat.setPaymentRequestEnabled].
962
994
paymentRequest,
995
+
996
+
/// Feature for isFeatureSupported.
997
+
///
998
+
/// This feature covers [WebSettingsCompat.setWebAuthenticationSupport].
999
+
webAuthentication,
1000
+
}
1001
+
1002
+
/// Support levels for [android_webview.WebSettingsCompat.setWebAuthenticationSupport].
1003
+
///
1004
+
/// This enum provides a type-safe way to specify the WebAuthentication support
1005
+
/// level for a WebView.
1006
+
///
1007
+
/// See https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setWebAuthenticationSupport.
1008
+
enumWebAuthenticationSupport {
1009
+
/// Disables WebAuthn requests from WebView.
1010
+
///
1011
+
/// No WebAuthn APIs are available to web content in the WebView.
1012
+
none(0),
1013
+
1014
+
/// Allows WebAuthn requests for the embedded app.
1015
+
///
1016
+
/// WebAuthn is available for Relying Party IDs that are registered for the
1017
+
/// embedding application.
1018
+
forApp(1),
1019
+
1020
+
/// Allows WebAuthn calls for any website.
1021
+
///
1022
+
/// WebAuthn is available for any Relying Party ID. This is the typical
1023
+
/// configuration for a browser-like experience.
1024
+
forBrowser(2);
1025
+
1026
+
constWebAuthenticationSupport(this.value);
1027
+
1028
+
/// The platform integer expected by `WebSettingsCompat`.
1029
+
finalint value;
963
1030
}
964
1031
965
1032
/// Parameters received when the `WebView` should show a file selector.
0 commit comments