Commit 0c9f843f authored by Josh Nohle's avatar Josh Nohle Committed by Commit Bot

[DeviceSync v2] Add authorized entity number for v2 DeviceSync project

CryptAuth v2 Enrollment and v2 DeviceSync are separate
Cloud/Pantheon/Firebase projects that need separate authorization to
send push notifications to the client. The authorized entity values here
identify the v2 Enrollment and v2 DeviceSync Cloud/Pantheon/Firebase
projects.

While the user's Instance ID can be used across multiple CryptAuth
projects, the Instance ID *tokens* are project specific. The authorized
entity values are needed to generate Instance ID tokens. These tokens
are unique and immutable identifiers of the client's authorization of
the project to send the client push notifications.

Bug: 951969, 990430
Change-Id: Iad38286357f71054530a9afc05c5dc2382edcbae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1735472
Commit-Queue: Josh Nohle <nohle@chromium.org>
Auto-Submit: Josh Nohle <nohle@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684451}
parent ff6e9ce5
...@@ -208,7 +208,7 @@ void ClientAppMetadataProviderService::OnInstanceIdFetched( ...@@ -208,7 +208,7 @@ void ClientAppMetadataProviderService::OnInstanceIdFetched(
DCHECK(!instance_id.empty()); DCHECK(!instance_id.empty());
instance_id_->GetToken( instance_id_->GetToken(
device_sync:: device_sync::
kCryptAuthGcmInstanceIdAuthorizedEntity /* authorized_entity */, kCryptAuthV2EnrollmentAuthorizedEntity /* authorized_entity */,
kInstanceIdScope /* scope */, kInstanceIdScope /* scope */,
std::map<std::string, std::string>() /* options */, {} /* flags */, std::map<std::string, std::string>() /* options */, {} /* flags */,
base::Bind(&ClientAppMetadataProviderService::OnInstanceIdTokenFetched, base::Bind(&ClientAppMetadataProviderService::OnInstanceIdTokenFetched,
......
...@@ -10,7 +10,8 @@ namespace device_sync { ...@@ -10,7 +10,8 @@ namespace device_sync {
const char kCryptAuthGcmAppId[] = "com.google.chrome.cryptauth"; const char kCryptAuthGcmAppId[] = "com.google.chrome.cryptauth";
const char kCryptAuthGcmSenderId[] = "381449029288"; const char kCryptAuthGcmSenderId[] = "381449029288";
const char kCryptAuthGcmInstanceIdAuthorizedEntity[] = "16502139086"; const char kCryptAuthV2EnrollmentAuthorizedEntity[] = "16502139086";
const char kCryptAuthV2DeviceSyncAuthorizedEntity[] = "302798585788";
} // namespace device_sync } // namespace device_sync
......
...@@ -12,7 +12,8 @@ namespace device_sync { ...@@ -12,7 +12,8 @@ namespace device_sync {
// ID constants used in GCM for CryptAuth-related calls. // ID constants used in GCM for CryptAuth-related calls.
extern const char kCryptAuthGcmAppId[]; extern const char kCryptAuthGcmAppId[];
extern const char kCryptAuthGcmSenderId[]; extern const char kCryptAuthGcmSenderId[];
extern const char kCryptAuthGcmInstanceIdAuthorizedEntity[]; extern const char kCryptAuthV2EnrollmentAuthorizedEntity[];
extern const char kCryptAuthV2DeviceSyncAuthorizedEntity[];
} // namespace device_sync } // namespace device_sync
......
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