GSignondPluginProxy *proxy;
GSequence *available_mechanisms;
GSignondIdentityInfo *identity_info;
+ GSignondDictionary *token_data;
};
G_DEFINE_TYPE (GSignondAuthSession, gsignond_auth_session, G_TYPE_OBJECT)
}
}
+ /* pass token data to session data */
+ if (self->priv->token_data) {
+ GVariant *token_data = gsignond_dictionary_to_variant (self->priv->token_data);
+ /* FIXME: better add API GSignondSessionData to support(set/get) token data.
+ That will be the cleaner solution */
+ gsignond_dictionary_set (session_data, "Token", token_data);
+ }
+
_ProcessData * data = g_slice_new0 (_ProcessData);
data->self = self;
data->ready_cb = ready_cb;
self->priv->identity_info = NULL;
}
+ if (self->priv->token_data) {
+ gsignond_dictionary_unref (self->priv->token_data);
+ self->priv->token_data = NULL;
+ }
+
G_OBJECT_CLASS (gsignond_auth_session_parent_class)->dispose (object);
}
* gsignond_auth_session_new:
* @info: instance of #GSignondIdentityInfo
* @method: authentication method
+ * @token_data: (transfer full) stored token data stored for #method
*
* Creates instance of #GSignondAuthSession.
*
* Returns: (transfer full) newly created object
*/
GSignondAuthSession *
-gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *method)
+gsignond_auth_session_new (GSignondIdentityInfo *info, const gchar *method, GSignondDictionary *token_data)
{
GSignondPluginProxy* proxy = NULL;
"method", method, NULL);
auth_session->priv->proxy = proxy;
auth_session->priv->identity_info = g_hash_table_ref ((GHashTable *)info);
+ auth_session->priv->token_data = token_data;
return auth_session;
}
GSignondAuthSession *session = NULL;
GHashTable *supported_methods = NULL;
gboolean method_available = FALSE;
+ guint32 identity_id ;
+ GSignondDictionary *token_data = NULL;
VALIDATE_IDENTITY_READ_ACCESS (identity, ctx, NULL);
return NULL;
}
- session = gsignond_auth_session_new (identity->priv->info, method);
+ if ( (identity_id = gsignond_identity_info_get_id (identity->priv->info)) !=
+ GSIGNOND_IDENTITY_INFO_NEW_IDENTITY) {
+ token_data = gsignond_daemon_load_identity_data (identity->priv->owner, identity_id, method);
+ } else {
+ /* TODO : load cached token data for unsaved identity */
+ }
+
+ session = gsignond_auth_session_new (identity->priv->info, method, token_data);
if (!session) {
if (error) *error = gsignond_get_gerror_for_id (GSIGNOND_ERROR_UNKNOWN, "Unknown error");