[gnome-online-accounts] google: Add the btmpl parameter to the authorization URI



commit 6d1e54592eb549c0faa248ec684587b722a809a2
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Mar 15 01:03:01 2012 +0100

    google: Add the btmpl parameter to the authorization URI
    
    Using btmpl=mobile is supposed to give the mobile version of the page
    according to:
    https://developers.google.com/accounts/docs/OAuth_ref#GetAuth
    
    It is a different story that it is currently not working with Google's
    new authentication page.
    
    See: https://bugzilla.gnome.org/659435

 src/goabackend/goagoogleprovider.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/goabackend/goagoogleprovider.c b/src/goabackend/goagoogleprovider.c
index eaf2f6c..edb2d26 100644
--- a/src/goabackend/goagoogleprovider.c
+++ b/src/goabackend/goagoogleprovider.c
@@ -96,6 +96,17 @@ get_request_uri (GoaOAuthProvider *provider)
   return "https://www.google.com/accounts/OAuthGetRequestToken";;
 }
 
+static gchar *
+build_authorization_uri (GoaOAuthProvider  *provider,
+                         const gchar       *authorization_uri,
+                         const gchar       *escaped_oauth_token)
+{
+  return g_strdup_printf ("%s"
+                          "?oauth_token=%s&btmpl=mobile",
+                          authorization_uri,
+                          escaped_oauth_token);
+}
+
 static gchar **
 get_request_uri_params (GoaOAuthProvider *provider)
 {
@@ -492,6 +503,7 @@ goa_google_provider_class_init (GoaGoogleProviderClass *klass)
   oauth_class->get_authorization_uri    = get_authorization_uri;
   oauth_class->get_token_uri            = get_token_uri;
   oauth_class->get_callback_uri         = get_callback_uri;
+  oauth_class->build_authorization_uri  = build_authorization_uri;
   oauth_class->get_use_external_browser = get_use_external_browser;
   oauth_class->add_account_key_values   = add_account_key_values;
 }



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