webRequest.onAuthRequired listeners can provide authentication credentials.
onAuthRequired listeners that specify "blocking" in the extraInfoSpec can return authentication credentials [username and password] in the BlockingResponse. If these are provided, Chrome will use these credentials rather than showing a login prompt for the user.
If "blocking" is not specified, or an authCredentials object is not present in the BlockingResponse, then a login prompt will be displayed.
Warning: If the authentication credentials are invalid, the extension may still present credentials for subsequent challenges. This could lead to infinite loops of bad credentials being entered without user intervention.
BUG=32056
TEST=Write an extension which does a blocking onAuthRequired and provides correct credentials, validate that it works.
Review URL: http://codereview.chromium.org/8015004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@104896 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index db964606..b6a41b7 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -176,7 +176,7 @@
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
net::AuthCredentials* credentials) {
- ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired(
- profile_, extension_info_map_.get(), request, auth_info);
- return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
+ return ExtensionWebRequestEventRouter::GetInstance()->OnAuthRequired(
+ profile_, extension_info_map_.get(), request, auth_info,
+ callback, credentials);
}