[gnome-online-accounts] oauth2: Support getting refresh_token from uri fragment
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-online-accounts] oauth2: Support getting refresh_token from uri fragment
- Date: Fri, 8 Feb 2013 13:29:06 +0000 (UTC)
commit 5a945e0cea0d575c99eac3743212d91162510639
Author: Jack Leigh <jack leigh collabora co uk>
Date: Fri Feb 8 14:27:09 2013 +0100
oauth2: Support getting refresh_token from uri fragment
This is how it is returned by the Salesforce OAuth2 API.
Fixes: https://bugzilla.gnome.org/692936
src/goabackend/goaoauth2provider.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/goabackend/goaoauth2provider.c b/src/goabackend/goaoauth2provider.c
index d349f6d..9aedc33 100644
--- a/src/goabackend/goaoauth2provider.c
+++ b/src/goabackend/goaoauth2provider.c
@@ -847,8 +847,9 @@ on_web_view_navigation_policy_decision_requested (WebKitWebView *web
* expiration values, using the same syntax as a URL query */
key_value_pairs = soup_form_decode (soup_uri_get_fragment (uri));
- /* we might use oauth2_proxy_extract_access_token() here but we need
- * also to extract the expire time */
+ /* We might use oauth2_proxy_extract_access_token() here but
+ * we can also extract other information.
+ */
data->access_token = g_strdup (g_hash_table_lookup (key_value_pairs, "access_token"));
if (data->access_token != NULL)
{
@@ -862,6 +863,8 @@ on_web_view_navigation_policy_decision_requested (WebKitWebView *web
if (expires_in_str != NULL)
data->access_token_expires_in = atoi (expires_in_str);
+ data->refresh_token = g_strdup (g_hash_table_lookup (key_value_pairs, "refresh_token"));
+
gtk_dialog_response (data->dialog, GTK_RESPONSE_OK);
}
else
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]