OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/http/http_auth_handler_negotiate.h" | 5 #include "net/http/http_auth_handler_negotiate.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 | 176 |
177 bool HttpAuthHandlerNegotiate::AllowsDefaultCredentials() { | 177 bool HttpAuthHandlerNegotiate::AllowsDefaultCredentials() { |
178 if (target_ == HttpAuth::AUTH_PROXY) | 178 if (target_ == HttpAuth::AUTH_PROXY) |
179 return true; | 179 return true; |
180 if (!url_security_manager_) | 180 if (!url_security_manager_) |
181 return false; | 181 return false; |
182 return url_security_manager_->CanUseDefaultCredentials(origin_); | 182 return url_security_manager_->CanUseDefaultCredentials(origin_); |
183 } | 183 } |
184 | 184 |
| 185 bool HttpAuthHandlerNegotiate::AllowsExplicitCredentials() { |
| 186 return auth_system_.AllowsExplicitCredentials(); |
| 187 } |
| 188 |
185 // The Negotiate challenge header looks like: | 189 // The Negotiate challenge header looks like: |
186 // WWW-Authenticate: NEGOTIATE auth-data | 190 // WWW-Authenticate: NEGOTIATE auth-data |
187 bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) { | 191 bool HttpAuthHandlerNegotiate::Init(HttpAuth::ChallengeTokenizer* challenge) { |
188 #if defined(OS_POSIX) | 192 #if defined(OS_POSIX) |
189 if (!auth_system_.Init()) { | 193 if (!auth_system_.Init()) { |
190 VLOG(1) << "can't initialize GSSAPI library"; | 194 VLOG(1) << "can't initialize GSSAPI library"; |
191 return false; | 195 return false; |
192 } | 196 } |
193 // GSSAPI does not provide a way to enter username/password to | 197 // GSSAPI does not provide a way to enter username/password to |
194 // obtain a TGT. If the default credentials are not allowed for | 198 // obtain a TGT. If the default credentials are not allowed for |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 bool HttpAuthHandlerNegotiate::CanDelegate() const { | 334 bool HttpAuthHandlerNegotiate::CanDelegate() const { |
331 // TODO(cbentzel): Should delegation be allowed on proxies? | 335 // TODO(cbentzel): Should delegation be allowed on proxies? |
332 if (target_ == HttpAuth::AUTH_PROXY) | 336 if (target_ == HttpAuth::AUTH_PROXY) |
333 return false; | 337 return false; |
334 if (!url_security_manager_) | 338 if (!url_security_manager_) |
335 return false; | 339 return false; |
336 return url_security_manager_->CanDelegate(origin_); | 340 return url_security_manager_->CanDelegate(origin_); |
337 } | 341 } |
338 | 342 |
339 } // namespace net | 343 } // namespace net |
OLD | NEW |