[gnome-online-accounts] oauth2: Don't add redirect_uri when grant_type=refresh_token
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] oauth2: Don't add redirect_uri when grant_type=refresh_token
- Date: Fri, 2 Nov 2012 19:24:17 +0000 (UTC)
commit a0342f7392d9734cd4ddc30ae44df8e5915dcdf5
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Sat Oct 20 02:36:49 2012 +0200
oauth2: Don't add redirect_uri when grant_type=refresh_token
Google complains loudly when we do so. See:
https://developers.google.com/accounts/docs/OAuth2InstalledApp#refresh
Fixes: https://bugzilla.gnome.org/686519
src/goabackend/goaoauth2provider.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index 2e1a23f..0d631df 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -512,7 +512,6 @@ get_tokens_sync (GoaOAuth2Provider *provider,
rest_proxy_call_set_method (call, "POST");
rest_proxy_call_add_header (call, "Content-Type", "application/x-www-form-urlencoded");
rest_proxy_call_add_param (call, "client_id", goa_oauth2_provider_get_client_id (provider));
- rest_proxy_call_add_param (call, "redirect_uri", goa_oauth2_provider_get_redirect_uri (provider));
client_secret = goa_oauth2_provider_get_client_secret (provider);
if (client_secret != NULL)
@@ -528,6 +527,7 @@ get_tokens_sync (GoaOAuth2Provider *provider,
{
/* No refresh code.. request an access token using the authorization code instead */
rest_proxy_call_add_param (call, "grant_type", "authorization_code");
+ rest_proxy_call_add_param (call, "redirect_uri", goa_oauth2_provider_get_redirect_uri (provider));
rest_proxy_call_add_param (call, "code", authorization_code);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]