ApOAuthPlugin

ApOAuthPlugin — Base class for account plugins using OAuth authentication.

Synopsis

#include <libaccount-plugin/oauth-plugin.h>

                    ApOAuthPlugin;
enum                ApOAuthMechanism;
void                ap_oauth_plugin_set_mechanism       (ApOAuthPlugin *self,
                                                         ApOAuthMechanism mechanism);
void                ap_oauth_plugin_set_oauth_parameters
                                                        (ApOAuthPlugin *self,
                                                         GHashTable *oauth_params);
void                ap_oauth_plugin_set_account_oauth_parameters
                                                        (ApOAuthPlugin *self,
                                                         GHashTable *oauth_params);

Object Hierarchy

  GObject
   +----ApPlugin
         +----ApOAuthPlugin

Properties

  "oauth-params"             GHashTable*           : Read / Write / Construct Only

Description

This class helps creating account plugins which use the OAuth authentication method.

Details

ApOAuthPlugin

typedef struct _ApOAuthPlugin ApOAuthPlugin;

Use the accessor functions below.


enum ApOAuthMechanism

typedef enum {
    AP_OAUTH_MECHANISM_USER_AGENT = 0,
    AP_OAUTH_MECHANISM_WEB_SERVER,
    AP_OAUTH_MECHANISM_HMAC_SHA1,
    AP_OAUTH_MECHANISM_PLAINTEXT,
    AP_OAUTH_MECHANISM_RSA_SHA1,
} ApOAuthMechanism;

The authentication mechanism to be used.

AP_OAUTH_MECHANISM_USER_AGENT

OAuth 2.0, user-agent flow (default)

AP_OAUTH_MECHANISM_WEB_SERVER

OAuth 2.0, web-server flow

AP_OAUTH_MECHANISM_HMAC_SHA1

OAuth 1.0a, signing type: HMAC-SHA1

AP_OAUTH_MECHANISM_PLAINTEXT

OAuth 1.0a, signing type: PLAINTEXT

AP_OAUTH_MECHANISM_RSA_SHA1

OAuth 1.0a, signing type: RSA-SHA1

ap_oauth_plugin_set_mechanism ()

void                ap_oauth_plugin_set_mechanism       (ApOAuthPlugin *self,
                                                         ApOAuthMechanism mechanism);

Set the OAuth mechanism to be used when authenticating the account.

self :

the ApOAuthPlugin.

mechanism :

the desired OAuth mechanism.

ap_oauth_plugin_set_oauth_parameters ()

void                ap_oauth_plugin_set_oauth_parameters
                                                        (ApOAuthPlugin *self,
                                                         GHashTable *oauth_params);

Sets the dictionary of OAuth parameters to be used when authenticating the account. Note that these parameters are not stored in the account and will be used only by the account plugin. To set the authentication parameters used by applications, use ap_oauth_plugin_set_account_oauth_parameters().

self :

the ApOAuthPlugin.

oauth_params :

a dictionary of OAuth parameters. [element-type utf8 GValue]

ap_oauth_plugin_set_account_oauth_parameters ()

void                ap_oauth_plugin_set_account_oauth_parameters
                                                        (ApOAuthPlugin *self,
                                                         GHashTable *oauth_params);

Sets the dictionary of OAuth parameters to be used by client applications when authenticating the account. These are the parameters which will be stored into the account configuration (those used by the plugin itself when authenticating are those set with ap_oauth_plugin_set_oauth_parameters()).

self :

the ApOAuthPlugin.

oauth_params :

a dictionary of OAuth parameters. [element-type utf8 GValue]

Property Details

The "oauth-params" property

  "oauth-params"             GHashTable*           : Read / Write / Construct Only

A dictionary of OAuth parameters, to be used when authenticating an account.