Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[telepathy-sasl-signon] Include ClientSecret in signon requests if de…
…fined

Fixes signon with some services (e.g. google) that require ClientSecret
for refreshing tokens.
  • Loading branch information
John Brooks committed Sep 27, 2013
1 parent 1a95c10 commit 425be15
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion telepathy-sasl-signon/empathy-uoa-auth-handler.c
Expand Up @@ -213,7 +213,6 @@ session_process_cb (SignonAuthSession *session,
{
AuthContext *ctx = user_data;
const gchar *access_token;
const gchar *client_id;
const gchar *auth_method;

if (error != NULL)
Expand Down Expand Up @@ -275,6 +274,7 @@ identity_query_info_cb (SignonIdentity *identity,
gpointer user_data)
{
AuthContext *ctx = user_data;
gchar *client_secret = 0;

if (error != NULL)
{
Expand Down Expand Up @@ -311,6 +311,12 @@ identity_query_info_cb (SignonIdentity *identity,
if (ctx->client_id)
tp_asv_set_string (params, "ClientId", ctx->client_id);

SailfishKeyProvider_storedKey (ag_service_get_provider (service),
ag_service_get_name (service), "client_secret", &client_secret);
if (client_secret)
tp_asv_set_string (params, "ClientSecret", client_secret);
g_free(client_secret);

tp_asv_set_int32 (params, SIGNON_SESSION_DATA_UI_POLICY, SIGNON_POLICY_NO_USER_INTERACTION);

signon_auth_session_process (ctx->session,
Expand Down

0 comments on commit 425be15

Please sign in to comment.