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 { ...@@ -71,12 +71,11 @@ class AuthPolicyClientImpl : public AuthPolicyClient {
void RefreshUserPolicy(const AccountId& account_id, void RefreshUserPolicy(const AccountId& account_id,
const RefreshPolicyCallback& callback) override { const RefreshPolicyCallback& callback) override {
DCHECK(account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY);
dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface, dbus::MethodCall method_call(authpolicy::kAuthPolicyInterface,
authpolicy::kAuthPolicyRefreshUserPolicy); authpolicy::kAuthPolicyRefreshUserPolicy);
dbus::MessageWriter writer(&method_call); dbus::MessageWriter writer(&method_call);
// TODO(tnagel): Switch to GUID once authpolicyd, session_manager and writer.AppendString(account_id.GetAccountIdKey());
// cryptohome support it, cf. https://crbug.com/677497.
writer.AppendString(account_id.GetUserEmail());
proxy_->CallMethod( proxy_->CallMethod(
&method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, &method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback, base::Bind(&AuthPolicyClientImpl::HandleRefreshPolicyCallback,
......
...@@ -212,17 +212,17 @@ void EnsureCryptohomeMigratedToGaiaId( ...@@ -212,17 +212,17 @@ void EnsureCryptohomeMigratedToGaiaId(
scoped_refptr<CryptohomeAuthenticator> resolver, scoped_refptr<CryptohomeAuthenticator> resolver,
bool ephemeral, bool ephemeral,
bool create_if_nonexistent) { 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(); const bool is_gaiaid_migration_started = switches::IsGaiaIdMigrationStarted();
if (!is_gaiaid_migration_started) { if (!is_gaiaid_migration_started) {
UMACryptohomeMigrationToGaiaId(CryptohomeMigrationToGaiaId::NOT_STARTED); UMACryptohomeMigrationToGaiaId(CryptohomeMigrationToGaiaId::NOT_STARTED);
DoMount(attempt, resolver, ephemeral, create_if_nonexistent); DoMount(attempt, resolver, ephemeral, create_if_nonexistent);
return; return;
} }
if (attempt->user_context.GetAccountId().GetAccountType() ==
AccountType::ACTIVE_DIRECTORY) {
cryptohome::SetGaiaIdMigrationStatusDone(
attempt->user_context.GetAccountId());
}
const bool already_migrated = cryptohome::GetGaiaIdMigrationStatus( const bool already_migrated = cryptohome::GetGaiaIdMigrationStatus(
attempt->user_context.GetAccountId()); attempt->user_context.GetAccountId());
const bool has_account_key = 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