Add Single Sign On support to HTTP Authentication handlers.
Currently this is implemented on Windows for the NTLM and Negotiate schemes.
This CL does not introduce the hooks to actually use Single Sign On in response to a 401/407 request - that will come in a later CL.
This behavior is disabled for now as well.
BUG=29862
TEST=Ran unittests, and Chrome against a server with authentication challenges.
Review URL: http://codereview.chromium.org/555174
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38227 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/net/http/http_auth_handler.h b/net/http/http_auth_handler.h
index 02a410e..4b8f5261 100644
--- a/net/http/http_auth_handler.h
+++ b/net/http/http_auth_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -72,11 +72,32 @@
// single-round schemes.
virtual bool IsFinalRound() { return true; }
- // Generate the Authorization header value.
- virtual std::string GenerateCredentials(const std::wstring& username,
- const std::wstring& password,
- const HttpRequestInfo* request,
- const ProxyInfo* proxy) = 0;
+ // Returns whether the default credentials may be used for the |origin| passed
+ // into |InitFromChallenge|. If true, the user does not need to be prompted
+ // for username and password to establish credentials.
+ virtual bool AllowDefaultCredentials() { return false; }
+
+ // TODO(cbentzel): Separate providing credentials from generating the
+ // authentication token in the API.
+
+ // Generates an authentication token.
+ // The return value is an error code. If the code is not |OK|, the value of
+ // |*auth_token| is unspecified.
+ // |auth_token| is a return value and must be non-NULL.
+ virtual int GenerateAuthToken(const std::wstring& username,
+ const std::wstring& password,
+ const HttpRequestInfo* request,
+ const ProxyInfo* proxy,
+ std::string* auth_token) = 0;
+
+ // Generates an authentication token using default credentials.
+ // The return value is an error code. If the code is not |OK|, the value of
+ // |*auth_token| is unspecified.
+ // |auth_token| is a return value and must be non-NULL.
+ // This should only be called after |AllowDefaultCredentials| returns true.
+ virtual int GenerateDefaultAuthToken(const HttpRequestInfo* request,
+ const ProxyInfo* proxy,
+ std::string* auth_token) = 0;
protected:
enum Property {