[gnome-online-accounts/wip/oauth2: 6/10] oauth2: Access token request uses POST with authorization code grant



commit b88eab80b9a7fe52feaff6419d09d8c5f380f9e7
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Sep 13 14:37:36 2012 +0200

    oauth2: Access token request uses POST with authorization code grant
    
    This broke in 0b39d4c9c39d82084baf486d796f5fdad84cd2cc
    
    See: http://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.1.3

 src/goabackend/goaoauth2provider.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index 3eab89b..111ef4b 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -489,7 +489,8 @@ get_tokens_sync (GoaOAuth2Provider  *provider,
   proxy = rest_proxy_new (goa_oauth2_provider_get_token_uri (provider), FALSE);
   call = rest_proxy_new_call (proxy);
 
-  rest_proxy_call_set_method (call, "GET");
+  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));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]