OAuthProxy

OAuthProxy

Synopsis

                    OAuthProxy;
RestProxy*          oauth_proxy_new                     (const char *consumer_key,
                                                         const char *consumer_secret,
                                                         const gchar *url_format,
                                                         gboolean binding_required);
void                (*OAuthProxyAuthCallback)           (OAuthProxy *proxy,
                                                         GError *error,
                                                         GObject *weak_object,
                                                         gpointer userdata);
gboolean            oauth_proxy_auth_step               (OAuthProxy *proxy,
                                                         const char *function,
                                                         GError **error);
gboolean            oauth_proxy_auth_step_async         (OAuthProxy *proxy,
                                                         const char *function,
                                                         OAuthProxyAuthCallback callback,
                                                         GObject *weak_object,
                                                         gpointer user_data,
                                                         GError **error_out);
const char *        oauth_proxy_get_token               (OAuthProxy *proxy);

Description

Details

OAuthProxy

typedef struct {
  RestProxy parent;
} OAuthProxy;

oauth_proxy_new ()

RestProxy*          oauth_proxy_new                     (const char *consumer_key,
                                                         const char *consumer_secret,
                                                         const gchar *url_format,
                                                         gboolean binding_required);

OAuthProxyAuthCallback ()

void                (*OAuthProxyAuthCallback)           (OAuthProxy *proxy,
                                                         GError *error,
                                                         GObject *weak_object,
                                                         gpointer userdata);

oauth_proxy_auth_step ()

gboolean            oauth_proxy_auth_step               (OAuthProxy *proxy,
                                                         const char *function,
                                                         GError **error);

Perform an OAuth authorisation step. This calls function and then updates the token and token secret in the proxy.

proxy must not require binding, the function will be invoked using rest_proxy_call_set_function().

proxy :

an OAuthProxy

function :

the function to invoke on the proxy

oauth_proxy_auth_step_async ()

gboolean            oauth_proxy_auth_step_async         (OAuthProxy *proxy,
                                                         const char *function,
                                                         OAuthProxyAuthCallback callback,
                                                         GObject *weak_object,
                                                         gpointer user_data,
                                                         GError **error_out);

oauth_proxy_get_token ()

const char *        oauth_proxy_get_token               (OAuthProxy *proxy);

Get the current request or access token.

proxy :

Returns :

the token, or NULL if there is no token yet. This string is owned by OAuthProxy and should not be freed.