diff options
Diffstat (limited to 'chromium/net/http/http_auth_controller.cc')
-rw-r--r-- | chromium/net/http/http_auth_controller.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/chromium/net/http/http_auth_controller.cc b/chromium/net/http/http_auth_controller.cc index 9f7923bb524..2442e7b726a 100644 --- a/chromium/net/http/http_auth_controller.cc +++ b/chromium/net/http/http_auth_controller.cc @@ -141,12 +141,14 @@ HttpAuthController::HttpAuthController( const GURL& auth_url, HttpAuthCache* http_auth_cache, HttpAuthHandlerFactory* http_auth_handler_factory, - HostResolver* host_resolver) + HostResolver* host_resolver, + HttpAuthPreferences::DefaultCredentials allow_default_credentials) : target_(target), auth_url_(auth_url), auth_origin_(auth_url.GetOrigin()), auth_path_(auth_url.path()), embedded_identity_used_(false), + allow_default_credentials_(allow_default_credentials), default_credentials_used_(false), http_auth_cache_(http_auth_cache), http_auth_handler_factory_(http_auth_handler_factory), @@ -528,12 +530,17 @@ bool HttpAuthController::SelectNextAuthIdentityToTry() { return true; } - // Use default credentials (single sign on) if this is the first attempt - // at identity. Do not allow multiple times as it will infinite loop. - // We use default credentials after checking the auth cache so that if - // single sign-on doesn't work, we won't try default credentials for future - // transactions. - if (!default_credentials_used_ && handler_->AllowsDefaultCredentials()) { + // Use default credentials (single sign-on) if they're allowed and this is the + // first attempt at using an identity. Do not allow multiple times as it will + // infinite loop. We use default credentials after checking the auth cache so + // that if single sign-on doesn't work, we won't try default credentials for + // future transactions. + if (!default_credentials_used_ && handler_->AllowsDefaultCredentials() && + // TODO(https://crbug.com/458508): Refactor |AllowsDefaultCredentials| + // to internally process |allow_default_credentials_| once it is + // passed along with the other |HttpAuthPreferences|. + allow_default_credentials_ == + HttpAuthPreferences::ALLOW_DEFAULT_CREDENTIALS) { identity_.source = HttpAuth::IDENT_SRC_DEFAULT_CREDENTIALS; identity_.invalid = false; default_credentials_used_ = true; |