Token data type is changed to GSignondDictionary.
GSignondSessionData *session_data);
void
gsignond_plugin_store (GSignondPlugin *self,
- GSignondSessionData *session_data);
+ GSignondDictionary *token_data);
void
gsignond_plugin_error (GSignondPlugin *self, GError *error);
void
signals[STORE] = g_signal_new ("store", G_TYPE_FROM_CLASS (g_class),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE,
- 1, GSIGNOND_TYPE_SESSION_DATA);
+ 1, GSIGNOND_TYPE_DICTIONARY);
signals[ERROR] = g_signal_new ("error", G_TYPE_FROM_CLASS (g_class),
G_SIGNAL_RUN_FIRST, 0, NULL, NULL, NULL, G_TYPE_NONE,
}
void gsignond_plugin_store (GSignondPlugin *self,
- GSignondSessionData *session_data)
+ GSignondDictionary *token_data)
{
- g_signal_emit (self, signals[STORE], 0, session_data);
+ g_signal_emit (self, signals[STORE], 0, token_data);
}
void gsignond_plugin_error (GSignondPlugin *self, GError *error)
NULL,
G_TYPE_NONE,
1,
- GSIGNOND_TYPE_SESSION_DATA);
-
+ GSIGNOND_TYPE_DICTIONARY);
+
signals[SIG_PROCESS_USER_ACTION_REQUIRED] = g_signal_new ("process-user-action-required",
GSIGNOND_TYPE_AUTH_SESSION,
G_SIGNAL_RUN_LAST,
void
gsignond_auth_session_notify_store (GSignondAuthSession *self,
- GSignondSessionData *session_data)
+ GSignondDictionary *token_data)
{
- g_signal_emit (self, signals[SIG_PROCESS_STORE], 0, session_data);
+ g_signal_emit (self, signals[SIG_PROCESS_STORE], 0, token_data);
}
void
#include <glib-object.h>
+#include <gsignond/gsignond-dictionary.h>
#include <gsignond/gsignond-identity-info.h>
#include <gsignond/gsignond-signonui-data.h>
#include <gsignond/gsignond-session-data.h>
void
gsignond_auth_session_notify_store (GSignondAuthSession *self,
- GSignondSessionData *session_data);
+ GSignondDictionary *token_data);
void
gsignond_auth_session_notify_user_action_required (GSignondAuthSession *self,
}
gboolean
-gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GHashTable *data)
+gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GSignondDictionary *data)
{
g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), FALSE);
return gsignond_db_credentials_database_remove_data (daemon->priv->db, identity_id, NULL);
}
+GSignondDictionary *
+gsignond_daemon_load_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method)
+{
+ g_return_val_if_fail (daemon && GSIGNOND_IS_DAEMON (daemon), NULL);
+ g_return_val_if_fail (identity_id, NULL);
+ g_return_val_if_fail (method, NULL);
+
+ return gsignond_db_credentials_database_load_data (daemon->priv->db, identity_id, method);
+}
+
GSignondIdentity *
gsignond_daemon_register_new_identity (GSignondDaemon *daemon,
const GSignondSecurityContext *ctx,
gsignond_daemon_remove_identity_reference (GSignondDaemon *daemon, guint32 identity_id, const GSignondSecurityContext *owner, const gchar *ref);
gboolean
-gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GHashTable *data);
+gsignond_daemon_store_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method, GSignondDictionary *data);
gboolean
gsignond_daemon_clear_identity_data (GSignondDaemon *daemon, guint32 identity_id);
+GSignondDictionary *
+gsignond_daemon_load_identity_data (GSignondDaemon *daemon, guint32 identity_id, const gchar *method);
+
guint
gsignond_daemon_get_timeout (GSignondDaemon *self) G_GNUC_CONST;
ui_data, _on_user_action_completed, _on_refresh_requested, session);
}
+static void
+_on_store_token (GSignondAuthSession *session, GSignondDictionary *token_data, gpointer userdata)
+{
+ GSignondIdentity *identity = GSIGNOND_IDENTITY (userdata);
+ guint32 identity_id = GSIGNOND_IDENTITY_INFO_NEW_IDENTITY;
+
+ g_return_if_fail (identity && session && GSIGNOND_IS_AUTH_SESSION (session));
+
+ identity_id = gsignond_identity_info_get_id (identity->priv->info);
+
+ if (identity_id == GSIGNOND_IDENTITY_INFO_NEW_IDENTITY)
+ /* TODO; cache token */
+ ;
+ else
+ gsignond_daemon_store_identity_data (identity->priv->owner, identity_id,
+ gsignond_auth_session_get_method (session), token_data);
+}
+
static gboolean
_compare_session_by_pointer (gpointer key, gpointer value, gpointer dead_object)
{
/* Handle 'ui' signanls on session */
g_signal_connect (session, "process-user-action-required", G_CALLBACK (_on_user_action_required), identity);
g_signal_connect (session, "process-refreshed", G_CALLBACK (_on_refresh_dialog), identity);
+ g_signal_connect (session, "process-store", G_CALLBACK (_on_store_token), identity);
g_hash_table_insert (identity->priv->auth_sessions, g_strdup (method), session);
g_object_weak_ref (G_OBJECT (session), _on_session_close, identity);
GSignondSessionData* result,
gpointer user_data);
static void gsignond_plugin_proxy_store_callback(GSignondPlugin* plugin,
- GSignondSessionData* result,
+ GSignondDictionary* token_data,
gpointer user_data);
static void gsignond_plugin_proxy_refreshed_callback(GSignondPlugin* plugin,
GSignondSessionData* result,
static void
gsignond_plugin_proxy_store_callback (GSignondPlugin *plugin,
- GSignondSessionData *result,
+ GSignondDictionary *token_data,
gpointer user_data)
{
GSignondPluginProxy *self = GSIGNOND_PLUGIN_PROXY (user_data);
in plugin proxy", priv->plugin_type);
return;
}
- gsignond_auth_session_notify_store (priv->active_session, result);
+ gsignond_auth_session_notify_store (priv->active_session, token_data);
}
static void