The host can provide a response with credentials for the authentication or
cancel the request. If the host sets the Cancel property to false but does not
provide either UserName or Password properties on the Response property, then
WebView2 will show the default authentication challenge dialog prompt to
the user.
Add an event handler for the BasicAuthenticationRequested event. BasicAuthenticationRequested event is raised when WebView encounters a Basic HTTP Authentication request as described in https://developer.mozilla.org/docs/Web/HTTP/Authentication, a Digest HTTP Authentication request as described in https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization#digest, an NTLM authentication or a Proxy Authentication request.
The host can provide a response with credentials for the authentication or cancel the request. If the host sets the Cancel property to false but does not provide either UserName or Password properties on the Response property, then WebView2 will show the default authentication challenge dialog prompt to the user.
\snippet ScenarioAuthentication.cpp BasicAuthenticationRequested