onReceivedHttpAuthRequest property
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebViewClient.onReceivedHttpAuthRequest', apiUrl: 'https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpAuthRequest(android.webkit.WebView,%20android.webkit.HttpAuthHandler,%20java.lang.String,%20java.lang.String)'), IOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview'), MacOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview'), WindowsPlatform(apiName: 'ICoreWebView2_10.add_BasicAuthenticationRequested', apiUrl: 'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_10?view=webview2-1.0.2849.39#add_basicauthenticationrequested'), LinuxPlatform(apiName: 'WebKitWebView::authenticate', apiUrl: 'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.authenticate.html')])
final
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)
- Linux WPE WebKit (Official API - WebKitWebView::authenticate)
Parameters - Officially Supported Platforms/Implementations:
challenge: all platforms
Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebViewClient.onReceivedHttpAuthRequest',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedHttpAuthRequest(android.webkit.WebView,%20android.webkit.HttpAuthHandler,%20java.lang.String,%20java.lang.String)',
),
IOSPlatform(
apiName: 'WKNavigationDelegate.webView',
apiUrl:
'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview',
),
MacOSPlatform(
apiName: 'WKNavigationDelegate.webView',
apiUrl:
'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455638-webview',
),
WindowsPlatform(
apiName: 'ICoreWebView2_10.add_BasicAuthenticationRequested',
apiUrl:
'https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2_10?view=webview2-1.0.2849.39#add_basicauthenticationrequested',
),
LinuxPlatform(
apiName: 'WebKitWebView::authenticate',
apiUrl:
'https://wpewebkit.org/reference/stable/wpe-webkit-2.0/signal.WebView.authenticate.html',
),
],
)
final FutureOr<HttpAuthResponse?> Function(
T controller,
HttpAuthenticationChallenge challenge,
)?
onReceivedHttpAuthRequest;