I’m using a Cocoa WebView object and I’d like to suppress the authentication dialog that pops down when the user types in the wrong credentials. The server is sending back a Www-Authenticate response header which I believe is triggering the dialog.
Can I somehow intercept this header before it triggers the authentication challenge? Or is there some other way to disable the challenge dialog?
Take a look at the
WebResourceLoadDelegate. It has a methodwebView:resource:didReceiveAuthenticationChallenge:fromDataSource:that you can implement to intercept those WWW-Authenticate responses. Just make sure you callsetResourceLoadDelegate:on yourWebViewto give it your delegate class where that method is implemented.