Skip to content

Commit

Permalink
Remove kOAuthWrapBridgeUserInfoScope as it was duplicated
Browse files Browse the repository at this point in the history
kOAuthWrapBridgeUserInfoScope was a duplicate of kGoogleUserInfoEmail.
This CL removes it and replaces its usage with kGoogleUserInfoEmail

Bug: none
Change-Id: I4278e88801c1c84be116f95ca141b04571c7cc98
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2690631
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Reviewed-by: David Roger <droger@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#853482}
  • Loading branch information
Mihai Sardarescu authored and Chromium LUCI CQ committed Feb 12, 2021
1 parent f4d7010 commit 926315c
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void PasswordSyncTokenFetcher::StartAccessTokenFetch() {
// if the refresh token is available, or that it will be requested once the
// refresh token is available for the primary account.
signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);

access_token_fetcher_ =
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chromeos/login/saml/saml_browsertest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1231,7 +1231,7 @@ void SAMLEnrollmentTest::SetUpOnMainThread() {
FakeGaia::AccessTokenInfo token_info;
token_info.token = kTestUserinfoToken;
token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
token_info.scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();
token_info.email = saml_test_users::kFirstUserCorpExampleComEmail;
fake_gaia_.fake_gaia()->IssueOAuthToken(kTestRefreshToken, token_info);
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/chromeos/login/test/fake_gaia_mixin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void FakeGaiaMixin::SetupFakeGaiaForChildUser(const std::string& user_email,

FakeGaia::AccessTokenInfo user_info_token;
user_info_token.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
user_info_token.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
user_info_token.scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
user_info_token.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();

user_info_token.token = "fake-userinfo-token";
Expand Down Expand Up @@ -107,7 +107,7 @@ void FakeGaiaMixin::SetupFakeGaiaForChildUser(const std::string& user_email,
void FakeGaiaMixin::SetupFakeGaiaForLoginManager() {
FakeGaia::AccessTokenInfo token_info;
token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
token_info.scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();

token_info.token = kTestUserinfoToken1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void AndroidManagementClient::RequestAccessToken() {

signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);

access_token_fetcher_ = identity_manager_->CreateAccessTokenFetcherForAccount(
account_id_, "android_management_client", scopes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ void PolicyOAuth2TokenFetcherImpl::StartFetchingRefreshToken() {
void PolicyOAuth2TokenFetcherImpl::StartFetchingAccessToken() {
std::vector<std::string> scopes;
scopes.push_back(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.push_back(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.push_back(GaiaConstants::kGoogleUserInfoEmail);
access_token_fetcher_ =
GaiaAccessTokenFetcher::CreateExchangeRefreshTokenForAccessTokenInstance(
this, system_url_loader_factory_, oauth2_refresh_token_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class UserCloudPolicyManagerChromeOSTest
// Issue the access token with the former.
signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);

identity_test_env()
->WaitForAccessTokenRequestIfNecessaryAndRespondWithTokenForScopes(
Expand Down Expand Up @@ -1163,7 +1163,7 @@ class UserCloudPolicyManagerChromeOSChildTest
void IssueOAuth2AccessToken(base::TimeDelta token_lifetime) {
signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
identity_test_env()
->WaitForAccessTokenRequestIfNecessaryAndRespondWithTokenForScopes(
kOAuthToken, task_runner_->Now() + token_lifetime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void UserCloudPolicyTokenForwarder::StartRequest() {
// recurring token fetch for child user check and bail out here.
signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);

// NOTE: The primary account may not be available yet.
access_token_fetcher_ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class UserCloudPolicyTokenForwarderTest : public testing::Test {
void IssueOAuthToken(const std::string& token, base::Time expiration) {
signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
identity_test_env_profile_adaptor_->identity_test_env()
->WaitForAccessTokenRequestIfNecessaryAndRespondWithTokenForScopes(
token, expiration, std::string() /*id_token*/, scopes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void DeviceOAuth2TokenService::StartValidation() {

gaia_oauth_client_->RefreshToken(
client_info, store_->GetRefreshToken(),
std::vector<std::string>(1, GaiaConstants::kOAuthWrapBridgeUserInfoScope),
std::vector<std::string>(1, GaiaConstants::kGoogleUserInfoEmail),
max_refresh_token_validation_retries_, this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ void PlatformKeysTestBase::SetUpOnMainThread() {

FakeGaia::AccessTokenInfo token_info;
token_info.scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
token_info.scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
token_info.scopes.insert(GaiaConstants::kGoogleUserInfoEmail);
token_info.audience = GaiaUrls::GetInstance()->oauth2_chrome_client_id();
token_info.token = kTestUserinfoToken;
token_info.email = account_id_.GetUserEmail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class MachineLevelDeviceAccountInitializerHelper

std::set<std::string> GetRobotOAuthScopes() override {
return {
GaiaConstants::kOAuthWrapBridgeUserInfoScope,
GaiaConstants::kGoogleUserInfoEmail,
GaiaConstants::kFCMOAuthScope,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void CloudPolicyClientRegistrationHelper::IdentityManagerHelper::

signin::ScopeSet scopes;
scopes.insert(GaiaConstants::kDeviceManagementServiceOAuth);
scopes.insert(GaiaConstants::kOAuthWrapBridgeUserInfoScope);
scopes.insert(GaiaConstants::kGoogleUserInfoEmail);

access_token_fetcher_ = identity_manager->CreateAccessTokenFetcherForAccount(
account_id, "cloud_policy", scopes,
Expand Down
2 changes: 0 additions & 2 deletions google_apis/gaia/gaia_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ const char kRemotingService[] = "chromoting";

// OAuth scopes.
const char kOAuth1LoginScope[] = "https://www.google.com/accounts/OAuthLogin";
const char kOAuthWrapBridgeUserInfoScope[] =
"https://www.googleapis.com/auth/userinfo.email";

// Service/scope names for device management (cloud-based policy) server.
const char kDeviceManagementServiceOAuth[] =
Expand Down
1 change: 0 additions & 1 deletion google_apis/gaia/gaia_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ extern const char kRemotingService[];

// OAuth2 scopes.
extern const char kOAuth1LoginScope[];
extern const char kOAuthWrapBridgeUserInfoScope[];
extern const char kDeviceManagementServiceOAuth[];
extern const char kAnyApiOAuth2Scope[];
extern const char kChromeSyncOAuth2Scope[];
Expand Down

0 comments on commit 926315c

Please sign in to comment.