Skip to content

Commit

Permalink
Separate password change from time limiter
Browse files Browse the repository at this point in the history
This CL separates the dependency of the lock screen offline signin
limiter on the LockScreenReauthenticationEnabled policy, where before
it was required for this policy to be set to true in order for
forcing online re authentication on the lock screen to work, although
this policy is meant to be used for the saml password change feature.

Bug: 1204360
Change-Id: I65aaebd01b4f6c6c6bc261aa89e14e36f5a96be8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2878958
Commit-Queue: Aya Nader Elgendy‎ <ayag@chromium.org>
Reviewed-by: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880440}
  • Loading branch information
ayaNader authored and Chromium LUCI CQ committed May 7, 2021
1 parent 5080edb commit 10b58cd
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions chrome/browser/ash/login/signin/offline_signin_limiter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@
#include "chrome/browser/ash/login/login_constants.h"
#include "chrome/browser/ash/login/login_pref_names.h"
#include "chrome/browser/ash/login/reauth_stats.h"
#include "chrome/browser/ash/login/saml/in_session_password_sync_manager.h"
#include "chrome/browser/ash/login/saml/in_session_password_sync_manager_factory.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chromeos/components/proximity_auth/screenlock_bridge.h"
#include "components/prefs/pref_service.h"
#include "components/session_manager/core/session_manager.h"
#include "components/session_manager/core/session_manager_observer.h"
Expand Down Expand Up @@ -381,18 +380,24 @@ void OfflineSigninLimiter::ForceOnlineLockScreenReauth() {
DCHECK(user);

// Re-auth on lock - enabled only for the primary user.
InSessionPasswordSyncManager* password_sync_manager =
InSessionPasswordSyncManagerFactory::GetForProfile(profile_);
if (password_sync_manager) {
password_sync_manager->MaybeForceReauthOnLockScreen(
InSessionPasswordSyncManager::ReauthenticationReason::kPolicy);
proximity_auth::ScreenlockBridge* screenlock_bridge_ =
proximity_auth::ScreenlockBridge::Get();
DCHECK(screenlock_bridge_);

if (screenlock_bridge_->IsLocked()) {
// On the lock screen: need to update the UI.
screenlock_bridge_->lock_handler()->SetAuthType(
user->GetAccountId(), proximity_auth::mojom::AuthType::ONLINE_SIGN_IN,
std::u16string());
}
if (user->using_saml())

if (user->using_saml()) {
RecordReauthReason(user->GetAccountId(),
ReauthReason::SAML_LOCK_SCREEN_REAUTH_POLICY);
else
} else {
RecordReauthReason(user->GetAccountId(),
ReauthReason::GAIA_LOCK_SCREEN_REAUTH_POLICY);
}
offline_lock_screen_signin_limit_timer_->Stop();
}

Expand Down

0 comments on commit 10b58cd

Please sign in to comment.