summaryrefslogtreecommitdiffstats
path: root/google_apis
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-02 19:12:11 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-02 19:12:11 +0000
commit47b7c9a10ebc81548d70b3c266fdaad1c4f29946 (patch)
tree4473b132cbb5eff8c8875af46c055ab8ef34c139 /google_apis
parent8e9f51bd5f0b8af58fd1a9c31dee296f6f07c2e6 (diff)
downloadchromium_src-47b7c9a10ebc81548d70b3c266fdaad1c4f29946.zip
chromium_src-47b7c9a10ebc81548d70b3c266fdaad1c4f29946.tar.gz
chromium_src-47b7c9a10ebc81548d70b3c266fdaad1c4f29946.tar.bz2
Let GaiaOAuthClient::GetTokensFromAuthCode use any given redirect URL.
BUG=153453 Review URL: https://chromiumcodereview.appspot.com/11038011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'google_apis')
-rw-r--r--google_apis/gaia/gaia_oauth_client.cc4
-rw-r--r--google_apis/gaia/gaia_oauth_client.h1
-rw-r--r--google_apis/gaia/gaia_oauth_client_unittest.cc5
3 files changed, 9 insertions, 1 deletions
diff --git a/google_apis/gaia/gaia_oauth_client.cc b/google_apis/gaia/gaia_oauth_client.cc
index 08bc7a2..cd04325 100644
--- a/google_apis/gaia/gaia_oauth_client.cc
+++ b/google_apis/gaia/gaia_oauth_client.cc
@@ -74,7 +74,9 @@ void GaiaOAuthClient::Core::GetTokensFromAuthCode(
true) +
"&client_secret=" +
net::EscapeUrlEncodedData(oauth_client_info.client_secret, true) +
- "&redirect_uri=oob&grant_type=authorization_code";
+ "&redirect_uri=" +
+ net::EscapeUrlEncodedData(oauth_client_info.redirect_uri, true) +
+ "&grant_type=authorization_code";
MakeGaiaRequest(post_body, max_retries, delegate);
}
diff --git a/google_apis/gaia/gaia_oauth_client.h b/google_apis/gaia/gaia_oauth_client.h
index fff51cf..3dad639 100644
--- a/google_apis/gaia/gaia_oauth_client.h
+++ b/google_apis/gaia/gaia_oauth_client.h
@@ -23,6 +23,7 @@ static const char kGaiaOAuth2Url[] =
struct OAuthClientInfo {
std::string client_id;
std::string client_secret;
+ std::string redirect_uri;
};
class GaiaOAuthClient {
diff --git a/google_apis/gaia/gaia_oauth_client_unittest.cc b/google_apis/gaia/gaia_oauth_client_unittest.cc
index 4991817..739898d 100644
--- a/google_apis/gaia/gaia_oauth_client_unittest.cc
+++ b/google_apis/gaia/gaia_oauth_client_unittest.cc
@@ -156,6 +156,7 @@ TEST_F(GaiaOAuthClientTest, NetworkFailure) {
OAuthClientInfo client_info;
client_info.client_id = "test_client_id";
client_info.client_secret = "test_client_secret";
+ client_info.redirect_uri = "test_redirect_uri";
GaiaOAuthClient auth(kGaiaOAuth2Url,
profile_.GetRequestContext());
auth.GetTokensFromAuthCode(client_info, "auth_code", 2, &delegate);
@@ -178,6 +179,7 @@ TEST_F(GaiaOAuthClientTest, NetworkFailureRecover) {
OAuthClientInfo client_info;
client_info.client_id = "test_client_id";
client_info.client_secret = "test_client_secret";
+ client_info.redirect_uri = "test_redirect_uri";
GaiaOAuthClient auth(kGaiaOAuth2Url,
profile_.GetRequestContext());
auth.GetTokensFromAuthCode(client_info, "auth_code", -1, &delegate);
@@ -199,6 +201,7 @@ TEST_F(GaiaOAuthClientTest, OAuthFailure) {
OAuthClientInfo client_info;
client_info.client_id = "test_client_id";
client_info.client_secret = "test_client_secret";
+ client_info.redirect_uri = "test_redirect_uri";
GaiaOAuthClient auth(kGaiaOAuth2Url,
profile_.GetRequestContext());
auth.GetTokensFromAuthCode(client_info, "auth_code", -1, &delegate);
@@ -218,6 +221,7 @@ TEST_F(GaiaOAuthClientTest, GetTokensSuccess) {
OAuthClientInfo client_info;
client_info.client_id = "test_client_id";
client_info.client_secret = "test_client_secret";
+ client_info.redirect_uri = "test_redirect_uri";
GaiaOAuthClient auth(kGaiaOAuth2Url,
profile_.GetRequestContext());
auth.GetTokensFromAuthCode(client_info, "auth_code", -1, &delegate);
@@ -236,6 +240,7 @@ TEST_F(GaiaOAuthClientTest, RefreshTokenSuccess) {
OAuthClientInfo client_info;
client_info.client_id = "test_client_id";
client_info.client_secret = "test_client_secret";
+ client_info.redirect_uri = "test_redirect_uri";
GaiaOAuthClient auth(kGaiaOAuth2Url,
profile_.GetRequestContext());
auth.GetTokensFromAuthCode(client_info, "auth_code", -1, &delegate);