diff options
author | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:13:29 +0000 |
---|---|---|
committer | cbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-05 19:13:29 +0000 |
commit | ac3fa8e2ef53e83b113d726209525f4af4aa46f1 (patch) | |
tree | cf3550a3155d263943062b68ea5b205035d22182 /net/socket_stream | |
parent | 5502208efd91894a34ef43a38d348b7f9acb3770 (diff) | |
download | chromium_src-ac3fa8e2ef53e83b113d726209525f4af4aa46f1.zip chromium_src-ac3fa8e2ef53e83b113d726209525f4af4aa46f1.tar.gz chromium_src-ac3fa8e2ef53e83b113d726209525f4af4aa46f1.tar.bz2 |
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
Diffstat (limited to 'net/socket_stream')
-rw-r--r-- | net/socket_stream/socket_stream.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/net/socket_stream/socket_stream.cc b/net/socket_stream/socket_stream.cc index 2a01f17..aae234e 100644 --- a/net/socket_stream/socket_stream.cc +++ b/net/socket_stream/socket_stream.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 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. // @@ -556,14 +556,21 @@ int SocketStream::DoWriteTunnelHeaders() { // HttpRequestInfo. // TODO(ukai): Add support other authentication scheme. if (auth_handler_.get() && auth_handler_->scheme() == "basic") { - std::string credentials = auth_handler_->GenerateCredentials( + std::string auth_token; + int rv = auth_handler_->GenerateAuthToken( auth_identity_.username, auth_identity_.password, NULL, - &proxy_info_); + &proxy_info_, + &auth_token); + // TODO(cbentzel): Should do something different if credentials + // can't be generated. In this case, only Basic is allowed which + // should only fail if Base64 encoding fails. + if (rv != OK) + auth_token = std::string(); authorization_headers.append( HttpAuth::GetAuthorizationHeaderName(HttpAuth::AUTH_PROXY) + - ": " + credentials + "\r\n"); + ": " + auth_token + "\r\n"); } tunnel_request_headers_->headers_ = StringPrintf( |