static void auth_session_state_changed_cb (GDBusProxy *proxy, gint state, gchar *message, gpointer user_data);
static void auth_session_remote_object_destroyed_cb (GDBusProxy *proxy, gpointer user_data);
-static gboolean auth_session_priv_init (SignonAuthSession *self, guint id, const gchar *method_name, GError **err);
+static gboolean auth_session_priv_init (SignonAuthSession *self, const gchar *method_name, GError **err);
static void auth_session_query_available_mechanisms_ready_cb (gpointer object, const GError *error, gpointer user_data);
static void auth_session_cancel_ready_cb (gpointer object, const GError *error, gpointer user_data);
*/
SignonAuthSession *
signon_auth_session_new (gpointer identity_proxy,
- gint id,
const gchar *method_name,
GError **err)
{
NULL));
g_return_val_if_fail (self != NULL, NULL);
- if (!auth_session_priv_init(self, id, method_name, err))
+ if (!auth_session_priv_init(self, method_name, err))
{
if (*err)
g_warning ("%s returned error: %s", G_STRFUNC, (*err)->message);
}
static gboolean
-auth_session_priv_init (SignonAuthSession *self, guint id,
+auth_session_priv_init (SignonAuthSession *self,
const gchar *method_name, GError **err)
{
g_return_val_if_fail (SIGNON_IS_AUTH_SESSION (self), FALSE);
SignonAuthSessionPrivate *priv = SIGNON_AUTH_SESSION_PRIV (self);
g_return_val_if_fail (priv, FALSE);
- priv->id = id;
priv->method_name = g_strdup (method_name);
priv->registering = TRUE;
GError *err = NULL;
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL, "Cannot create Iddentity object");
SignonAuthSession *auth_session = signon_identity_create_session(idty,
GError *err = NULL;
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL, "Cannot create Iddentity object");
SignonAuthSession *auth_session = signon_identity_create_session(idty,
GError *err = NULL;
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL, "Cannot create Iddentity object");
SignonAuthSession *auth_session = signon_identity_create_session(idty,
GError *err = NULL;
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL, "Cannot create Iddentity object");
SignonAuthSession *auth_session = signon_identity_create_session(idty,
START_TEST(test_auth_session_process_failure)
{
+ SignonIdentity *identity;
SignonAuthSession *auth_session;
GVariantBuilder builder;
GVariant *session_data;
g_type_init ();
- auth_session = signon_auth_session_new (0, "nonexisting-method", &error);
+ identity = signon_identity_new_from_db (0, NULL);
+ fail_unless (identity != NULL, "Cannot create Identity object");
+ auth_session = signon_auth_session_new (identity,
+ "nonexisting-method",
+ &error);
fail_unless (auth_session != NULL, "Cannot create AuthSession object");
fail_unless (error == NULL);
fail_unless (error->code == SIGNON_ERROR_METHOD_NOT_KNOWN);
g_object_unref (auth_session);
+ g_object_unref (identity);
end_test ();
}
if (main_loop == NULL)
main_loop = g_main_loop_new (NULL, FALSE);
- identity = signon_identity_new (NULL, NULL);
+ identity = signon_identity_new (NULL);
fail_unless (SIGNON_IS_IDENTITY (identity));
methods = g_hash_table_new (g_str_hash, g_str_equal);
signon_identity_store_credentials_with_args (identity,
"caption",
NULL,
NULL,
+ NULL,
0,
new_identity_store_credentials_cb,
&id);
{
g_type_init ();
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL);
fail_unless (SIGNON_IS_IDENTITY (idty),
"Failed to initialize the Identity.");
"caption",
NULL,
NULL,
+ NULL,
0,
store_credentials_identity_cb,
&last_id);
{
g_type_init ();
g_debug("%s", G_STRFUNC);
- SignonIdentity *idty = signon_identity_new(NULL, NULL);
+ SignonIdentity *idty = signon_identity_new(NULL);
fail_unless (idty != NULL);
fail_unless (SIGNON_IS_IDENTITY (idty),
"Failed to initialize the Identity.");
caption,
NULL,
NULL,
+ NULL,
0,
store_credentials_identity_cb,
NULL);
START_TEST(test_regression_unref)
{
+ SignonIdentity *identity;
SignonAuthSession *auth_session;
GHashTable *session_data;
GError *error = NULL;
g_type_init ();
main_loop = g_main_loop_new (NULL, FALSE);
- auth_session = signon_auth_session_new (0, "ssotest", &error);
+ identity = signon_identity_new_from_db (0, NULL);
+ fail_unless (identity != NULL);
+ auth_session = signon_auth_session_new (identity, "ssotest", &error);
fail_unless (auth_session != NULL);
session_data = g_hash_table_new (g_str_hash, g_str_equal);
g_strdup ("Hi there!"));
g_main_loop_run (main_loop);
+ g_object_unref (auth_session);
+ g_object_unref (identity);
+
end_test ();
}
END_TEST