Skip to content

[webview_flutter_android] Set support for web authentication - #11681

Merged
auto-submit[bot] merged 24 commits into
flutter:mainfrom
creatorpiyush:webview_flutter_android_set-Web-Authentication-Support
Aug 11, 2026
Merged

[webview_flutter_android] Set support for web authentication#11681
auto-submit[bot] merged 24 commits into
flutter:mainfrom
creatorpiyush:webview_flutter_android_set-Web-Authentication-Support

Conversation

@creatorpiyush

Copy link
Copy Markdown
Contributor

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.
working-example.mp4

List which issues are fixed by this PR. You must list at least one issue.
flutter/flutter#186312

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. 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.

Footnotes

  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. 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements Web Authentication support for the Android WebView, including the necessary Pigeon interface updates, native implementation, and example app integration. Feedback includes addressing a potential compatibility issue with Math.toIntExact on older Android APIs, renaming variables in documentation for clarity, and potentially using an enum to expose all support levels instead of a boolean toggle.

Comment thread packages/webview_flutter/webview_flutter_android/README.md Outdated
Comment thread packages/webview_flutter/webview_flutter_android/example/lib/readme_excerpts.dart Outdated
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

[x] I followed the version and CHANGELOG instructions, using semantic versioning and the repository CHANGELOG style, or I have commented below to indicate which documented exception this PR falls under1.

Thanks for the contribution! You’ve checked boxes in the PR checklist above that are not reflected in this PR, so I’m assuming this is a work in progress and am marking it as a Draft. Please review the checklist, updating the PR as appropriate, and when the state of the PR as posted reflects the checklist please feel free to mark it as ready for review.

@stuartmorgan-g
stuartmorgan-g marked this pull request as draft May 11, 2026 14:35
@creatorpiyush
creatorpiyush marked this pull request as ready for review May 11, 2026 15:02
@creatorpiyush

Copy link
Copy Markdown
Contributor Author

Hello @stuartmorgan-g, PR is up for review; that part was missed to be pushed.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces support for configuring Web Authentication (WebAuthn) in the AndroidWebViewController via the setWebAuthenticationSupport method. The changes include updates to the Pigeon interface, Android native implementation using WebSettingsCompat, and the Dart API with a new WebAuthenticationSupport enum. A high-severity issue was identified regarding the use of Math.toIntExact, which requires API level 24 and would cause crashes on devices running Android 5.0 to 7.0 (API 21-23) supported by this plugin. Additionally, the WebAuthenticationSupportConstants class should use the @Deprecated annotation instead of just a doc comment for proper IDE and compiler support.

@stuartmorgan-g stuartmorgan-g added the triage-android Should be looked at in Android triage label May 12, 2026
@mboetger
mboetger requested review from a team and gmackall and removed request for a team May 12, 2026 20:54
@creatorpiyush
creatorpiyush force-pushed the webview_flutter_android_set-Web-Authentication-Support branch from f7f9a80 to a43bb7d Compare May 19, 2026 10:29

@bparrishMines bparrishMines left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Added a few comments.

Comment thread packages/webview_flutter/webview_flutter_android/lib/webview_flutter_android.dart Outdated
@creatorpiyush
creatorpiyush force-pushed the webview_flutter_android_set-Web-Authentication-Support branch from 47978d4 to 2fcb70a Compare May 20, 2026 13:02
…on-Support

# Conflicts:
#	packages/webview_flutter/webview_flutter_android/CHANGELOG.md
#	packages/webview_flutter/webview_flutter_android/lib/src/android_webkit.g.dart
#	packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart
#	packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.dart
@creatorpiyush

Copy link
Copy Markdown
Contributor Author

Hello @camsim99, Please review, rebase done

@creatorpiyush

Copy link
Copy Markdown
Contributor Author

Hello,

Due to a setup change and wrong email config a commit was used with wrong email please accept the CLA check
d7a9c6c Author: <piy******and​@nagaroo.com>

Updated minimum supported SDK version to Flutter 3.38/Dart 3.10.
@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

Due to a setup change and wrong email config a commit was used with wrong email please accept the CLA check

We cannot accept a PR that has commits that don't correspond to a signed CLA email. If you are the author and the problem is a local configuration error, you need to fix your local configuration, amend the commit, and then re-push with the correct authorship information.

@stuartmorgan-g

Copy link
Copy Markdown
Collaborator

@creatorpiyush Are you still planning to fix the CLA issue here? If the email address was wrong locally, you need to amend the commit and push. We cannot override the check for this.

@creatorpiyush

Copy link
Copy Markdown
Contributor Author

Hello @stuartmorgan-g, the issue is now fixed. Please review

@bparrishMines

Copy link
Copy Markdown
Contributor

@creatorpiyush There are still analysis errors from the CI that need fixing :

Analyzing webview_flutter_android...

warning - lib/src/android_webview_controller.dart:796:41 - This case is covered by the previous cases. Try removing the case clause, or restructuring the preceding patterns. - unreachable_switch_case
   info - test/android_webview_controller_test.dart:262:44 - Unnecessary use of multiple underscores. Try using '_'. - unnecessary_underscores

2 issues found.

@creatorpiyush-nagarro

Copy link
Copy Markdown

2 issues found.

Hello @bparrishMines, The issue is fixed

@gmackall

Copy link
Copy Markdown
Member

LGTM but you'll need to fix the repo checks as detailed in the logs in:
https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20repo_checks/24283/overview

creatorpiyush and others added 4 commits July 26, 2026 21:09
…ain/java/io/flutter/plugins/webviewflutter/WebSettingsCompatProxyApi.java

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
@creatorpiyush

Copy link
Copy Markdown
Contributor Author

Hello @bparrishMines,
Changes are ready...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: webview_flutter platform-android triage-android Should be looked at in Android triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants