Commit 6bc84229 authored by Mihai Sardarescu's avatar Mihai Sardarescu Committed by Commit Bot

OAuth client ID and secret are mandatory to sign in to Chrome.

This CL add a DCHECK to make it clear that signing in to Chrome requires
OAuth client ID and client secret to be configured.

Bug: 931903
Change-Id: I2cbbeb857d5ea96b1a7dfed28c20987009f1acc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1576569
Commit-Queue: Mihai Sardarescu <msarda@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656359}
parent 50943de5
......@@ -25,6 +25,7 @@
#include "content/public/browser/web_contents.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "google_apis/gaia/gaia_urls.h"
#include "google_apis/google_api_keys.h"
#include "services/identity/public/cpp/identity_manager.h"
#include "url/url_constants.h"
......@@ -179,9 +180,29 @@ void SigninViewController::ShowDiceSigninTab(
const std::string& email_hint,
const GURL& redirect_url) {
Profile* profile = browser->profile();
DCHECK(signin::DiceMethodGreaterOrEqual(
AccountConsistencyModeManager::GetMethodForProfile(profile),
signin::AccountConsistencyMethod::kDiceMigration));
#if DCHECK_IS_ON()
if (!signin::DiceMethodGreaterOrEqual(
AccountConsistencyModeManager::GetMethodForProfile(profile),
signin::AccountConsistencyMethod::kDiceMigration)) {
// Developers often fall into the trap of not configuring the OAuth client
// ID and client secret and then attempt to sign in to Chromium, which
// fail as the account consistency is disabled. Explicitly check that the
// OAuth client ID are configured when developers attempt to sign in to
// Chromium.
DCHECK(google_apis::HasOAuthClientConfigured())
<< "You must configure the OAuth client ID and client secret in order "
"to sign in to Chromium. See instruction at "
"https://www.chromium.org/developers/how-tos/api-keys";
// Account consistency mode does not support signing in to Chrome due to
// some other unexpected reason. Signing in to Chrome is not supported.
NOTREACHED()
<< "OAuth client ID and client secret is configured, but "
"the account consistency mode does not support signing in to "
"Chromium.";
}
#endif
// If redirect_url is empty, we would like to redirect to the NTP, but it's
// not possible through the continue_url, because Gaia cannot redirect to
......
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