| Index: chrome/browser/chromeos/login/existing_user_controller.cc
|
| diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
|
| index 292427f308cba774cb887ad45fbb98c78948d8a0..2a305fa0c4dffd55c68cf17bb383697a5190efaf 100644
|
| --- a/chrome/browser/chromeos/login/existing_user_controller.cc
|
| +++ b/chrome/browser/chromeos/login/existing_user_controller.cc
|
| @@ -57,6 +57,7 @@
|
| #include "chromeos/dbus/dbus_thread_manager.h"
|
| #include "chromeos/dbus/power_manager_client.h"
|
| #include "chromeos/dbus/session_manager_client.h"
|
| +#include "chromeos/login/auth/authpolicy_login_helper.h"
|
| #include "chromeos/settings/cros_settings_names.h"
|
| #include "components/arc/arc_util.h"
|
| #include "components/google/core/browser/google_util.h"
|
| @@ -382,6 +383,8 @@ ExistingUserController::~ExistingUserController() {
|
|
|
| void ExistingUserController::CancelPasswordChangedFlow() {
|
| login_performer_.reset(nullptr);
|
| + if (authpolicy_login_helper_)
|
| + authpolicy_login_helper_->CancelRequestsAndRestart();
|
| PerformLoginFinishedActions(true /* start auto login timer */);
|
| }
|
|
|
| @@ -457,12 +460,28 @@ void ExistingUserController::PerformLogin(
|
| policy::BrowserPolicyConnectorChromeOS* connector =
|
| g_browser_process->platform_part()->browser_policy_connector_chromeos();
|
| if (connector->IsActiveDirectoryManaged() &&
|
| - user_context.GetAuthFlow() != UserContext::AUTH_FLOW_ACTIVE_DIRECTORY) {
|
| + user_context.GetUserType() != user_manager::USER_TYPE_ACTIVE_DIRECTORY) {
|
| PerformLoginFinishedActions(false /* don't start auto login timer */);
|
| ShowError(IDS_LOGIN_ERROR_GOOGLE_ACCOUNT_NOT_ALLOWED,
|
| "Google accounts are not allowed on this device");
|
| return;
|
| }
|
| + if (user_context.GetAccountId().GetAccountType() ==
|
| + AccountType::ACTIVE_DIRECTORY) {
|
| + DCHECK(user_context.GetKey()->GetKeyType() == Key::KEY_TYPE_PASSWORD_PLAIN);
|
| + if (!authpolicy_login_helper_)
|
| + authpolicy_login_helper_ = base::MakeUnique<AuthPolicyLoginHelper>();
|
| + // Try to get kerberos TGT while we have user's password typed on the pod
|
| + // screen. Failure to get TGT here is OK - that could mean e.g. Active
|
| + // Directory server is not reachable. We don't want to have user wait for
|
| + // the Active Directory Authentication on the pod screen. In the follow-up
|
| + // CL we're gonna create KeyedService inside the user session which would
|
| + // get status about last authentication and handle possible failures.
|
| + authpolicy_login_helper_->TryAuthenticateUser(
|
| + user_context.GetAccountId().GetUserEmail(),
|
| + user_context.GetAccountId().GetObjGuid(),
|
| + user_context.GetKey()->GetSecret());
|
| + }
|
|
|
| if (gaia::ExtractDomainName(user_context.GetAccountId().GetUserEmail()) ==
|
| user_manager::kSupervisedUserDomain) {
|
| @@ -718,6 +737,8 @@ void ExistingUserController::OnAuthFailure(const AuthFailure& failure) {
|
| if (auth_status_consumer_)
|
| auth_status_consumer_->OnAuthFailure(failure);
|
|
|
| + if (authpolicy_login_helper_)
|
| + authpolicy_login_helper_->CancelRequestsAndRestart();
|
| ClearRecordedNames();
|
|
|
| // TODO(ginkage): Fix this case once crbug.com/469990 is ready.
|
| @@ -886,6 +907,8 @@ void ExistingUserController::WhiteListCheckFailed(const std::string& email) {
|
| AuthFailure(AuthFailure::WHITELIST_CHECK_FAILED));
|
| }
|
|
|
| + if (authpolicy_login_helper_)
|
| + authpolicy_login_helper_->CancelRequestsAndRestart();
|
| ClearRecordedNames();
|
| }
|
|
|
| @@ -893,6 +916,8 @@ void ExistingUserController::PolicyLoadFailed() {
|
| ShowError(IDS_LOGIN_ERROR_OWNER_KEY_LOST, "");
|
|
|
| PerformLoginFinishedActions(false /* don't start auto login timer */);
|
| + if (authpolicy_login_helper_)
|
| + authpolicy_login_helper_->CancelRequestsAndRestart();
|
| ClearRecordedNames();
|
| }
|
|
|
|
|