First and foremost, the latest guidance is that authentication should not be done inside a web view, the modern approach is to open external browser window, where the user authenticates and is then redirected back to the app using a custom URI scheme. See a detailed post on this here on SO.
Now, the unfortunate answer is that WebView
does not offer a built-in way to access the HTTP response and its headers. This has been requested (see for example this blog post by Martin Suchan), but was not implemented so far. If you have control over the web page, then you could store the authentication info in cookies, which are accessible. Not even injecting custom JavaScript can help here, because getting the HTTP headers is possible if you initiate an AJAX request in JS, but you can't get headers for a page that is already loaded.
As mentioned in comments above, the better solution would be to code the login manually using HttpClient
or see if the service support a proper OAuth2/OpenID Connect flow in which case you could use a library like IdentityModel.OidcClient2
which can handle most of the heavy lifting for you.
You can also use the built-in WebAuthenticationBroker
, see docs here.