onReceivedHttpAuthRequest method
FutureOr<HttpAuthResponse?> ?
onReceivedHttpAuthRequest(
- HttpAuthenticationChallenge challenge
inherited
Event fired when the WebView received an HTTP authentication request. The default behavior is to cancel the request.
challenge contains data about host, port, protocol, realm, etc. as specified in the URLAuthenticationChallenge.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebViewClient.onReceivedHttpAuthRequest)
- iOS WKWebView (Official API - WKNavigationDelegate.webView)
- macOS WKWebView (Official API - WKNavigationDelegate.webView)
- Windows WebView2 (Official API - ICoreWebView2_10.add_BasicAuthenticationRequested)
Parameters - Officially Supported Platforms/Implementations:
challenge: all platforms
Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.
Implementation
@override
FutureOr<HttpAuthResponse?>? onReceivedHttpAuthRequest(
HttpAuthenticationChallenge challenge,
) {
return null;
}