Commit 65de674c authored by rsorokin's avatar rsorokin Committed by Commit bot

Use AccountIdKey to identify Active Directory accounts.

It ties SessionManager, AuthPolicy, Cryptohome

BUG=677497
TEST=manual

Review-Url: https://codereview.chromium.org/2601283002
Cr-Commit-Position: refs/heads/master@{#443547}
parent 63811293
......@@ -71,12 +71,11 @@ class AuthPolicyClientImpl : public AuthPolicyClient {
void RefreshUserPolicy(const AccountId& account_id,
const RefreshPolicyCallback& callback) override {
DCHECK(account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY);
dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface,
authpolicy::kAuthPolicyRefreshUserPolicy);
dbus::MessageWriter writer(&method_call);
// TODO(tnagel): Switch to GUID once authpolicyd, session_manager and
// cryptohome support it, cf. https://crbug.com/677497.
writer.AppendString(account_id.GetUserEmail());
writer.AppendString(account_id.GetAccountIdKey());
proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback,
......
......@@ -212,17 +212,17 @@ void EnsureCryptohomeMigratedToGaiaId(
scoped_refptr<CryptohomeAuthenticator> resolver,
bool ephemeral,
bool create_if_nonexistent) {
if (attempt->user_context.GetAccountId().GetAccountType() ==
AccountType::ACTIVE_DIRECTORY) {
cryptohome::SetGaiaIdMigrationStatusDone(
attempt->user_context.GetAccountId());
}
const bool is_gaiaid_migration_started = switches::IsGaiaIdMigrationStarted();
if (!is_gaiaid_migration_started) {
UMACryptohomeMigrationToGaiaId(CryptohomeMigrationToGaiaId::NOT_STARTED);
DoMount(attempt, resolver, ephemeral, create_if_nonexistent);
return;
}
if (attempt->user_context.GetAccountId().GetAccountType() ==
AccountType::ACTIVE_DIRECTORY) {
cryptohome::SetGaiaIdMigrationStatusDone(
attempt->user_context.GetAccountId());
}
const bool already_migrated = cryptohome::GetGaiaIdMigrationStatus(
attempt->user_context.GetAccountId());
const bool has_account_key =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment