[evolution-data-server] EGDataGoaAuthorizer: OAuth 2.0 fixes.



commit 870bcc9eced87f74807cfeacb16f995a797eb277
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Oct 11 21:36:43 2012 -0400

    EGDataGoaAuthorizer: OAuth 2.0 fixes.
    
    Changes based on Google's OAuth 2.0 Playground.
    
    Authorization type is "OAuth" instead of "Bearer", and no Base64
    encoding of the access token is required.
    
    Still no successful test with GOA 3.7, so somewhat flying blind.

 .../backends/google/e-gdata-goa-authorizer.c       |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/addressbook/backends/google/e-gdata-goa-authorizer.c b/addressbook/backends/google/e-gdata-goa-authorizer.c
index d698ad0..abbba5a 100644
--- a/addressbook/backends/google/e-gdata-goa-authorizer.c
+++ b/addressbook/backends/google/e-gdata-goa-authorizer.c
@@ -283,7 +283,6 @@ gdata_goa_authorizer_add_oauth2_authorization (GDataAuthorizer *authorizer,
 {
 	EGDataGoaAuthorizerPrivate *priv;
 	GString *authorization;
-	gchar *base64_encoded;
 
 	/* This MUST be called with the mutex already locked. */
 
@@ -296,13 +295,8 @@ gdata_goa_authorizer_add_oauth2_authorization (GDataAuthorizer *authorizer,
 	if (priv->access_token == NULL)
 		return;
 
-	authorization = g_string_new ("Bearer ");
-
-	base64_encoded = g_base64_encode (
-		(guchar *) priv->access_token,
-		strlen (priv->access_token));
-	g_string_append (authorization, base64_encoded);
-	g_free (base64_encoded);
+	authorization = g_string_new ("OAuth ");
+	g_string_append (authorization, priv->access_token);
 
 	/* Use replace here, not append, to make sure
 	 * there's only one "Authorization" header. */



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