GFBGraphAuthorizer

GFBGraphAuthorizer — Facebook Graph API authorization interface.

Synopsis

#include <gfbgraph/gfbgraph.h>

struct              GFBGraphAuthorizerInterface;
void                gfbgraph_authorizer_process_call    (GFBGraphAuthorizer *iface,
                                                         RestProxyCall *call);
void                gfbgraph_authorizer_process_message (GFBGraphAuthorizer *iface,
                                                         SoupMessage *message);
gboolean            gfbgraph_authorizer_refresh_authorization
                                                        (GFBGraphAuthorizer *iface,
                                                         GCancellable *cancellable,
                                                         GError **error);

Description

GFBGraphAuthorizer interface provides a uniform way to implement authentication and authorization process for use by GFBGraph functions.

Details

struct GFBGraphAuthorizerInterface

struct GFBGraphAuthorizerInterface {
        GTypeInterface parent;

        void        (*process_call)          (GFBGraphAuthorizer *iface,
                                              RestProxyCall *call);
        void        (*process_message)       (GFBGraphAuthorizer *iface,
                                              SoupMessage *message);
        gboolean    (*refresh_authorization) (GFBGraphAuthorizer *iface,
                                              GCancellable *cancellable,
                                              GError **error);
};

Interface structure for GFBGraphAuthorizer. All methos should be thread safe.

GTypeInterface parent;

The parent interface.

process_call ()

A method to append authorization headers to a a RestProxyCall.

process_message ()

A method to append authorization headers to a SoupMessage.

refresh_authorization ()

A synchronous method to force a refresh of any authorization tokes held by the authorizer. It should return TRUE on succes.

gfbgraph_authorizer_process_call ()

void                gfbgraph_authorizer_process_call    (GFBGraphAuthorizer *iface,
                                                         RestProxyCall *call);

Adds the necessary authorization to call.

This method modifies call in place and is thread safe.

iface :

A GFBGraphAuthorizer.

call :

A RestProxyCall.

gfbgraph_authorizer_process_message ()

void                gfbgraph_authorizer_process_message (GFBGraphAuthorizer *iface,
                                                         SoupMessage *message);

Adds the necessary authorization to message. The type of message can be DELETE, GET and POST.

This method modifies message in place and is thread safe.

iface :

A GFBGraphAuthorizer.

message :

A SoupMessage.

gfbgraph_authorizer_refresh_authorization ()

gboolean            gfbgraph_authorizer_refresh_authorization
                                                        (GFBGraphAuthorizer *iface,
                                                         GCancellable *cancellable,
                                                         GError **error);

Synchronously forces iface to refresh any authorization tokens held by it.

This method is thread safe.

iface :

A GFBGraphAuthorizer.

cancellable :

An optional GCancellable object, or NULL. [allow-none]

error :

An optional GError, or NULL. [allow-none]

Returns :

TRUE if the authorizer now has a valid token.