]> git.0d.be Git - empathy.git/blob - libempathy/empathy-sasl-mechanisms.h
Implement Google X-OAUTH2 SASL mechanism
[empathy.git] / libempathy / empathy-sasl-mechanisms.h
1 /*
2  * empathy-sasl-mechanisms.h - Header for SASL authentication mechanisms
3  * Copyright (C) 2012 Collabora Ltd.
4  * @author Xavier Claessens <xavier.claessens@collabora.co.uk>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
19  */
20
21 #ifndef __EMPATHY_SASL_MECHANISMS_H__
22 #define __EMPATHY_SASL_MECHANISMS_H__
23
24 #include <telepathy-glib/telepathy-glib.h>
25
26 G_BEGIN_DECLS
27
28 typedef enum
29 {
30   EMPATHY_SASL_MECHANISM_UNSUPPORTED,
31   EMPATHY_SASL_MECHANISM_FACEBOOK,
32   EMPATHY_SASL_MECHANISM_WLM,
33   EMPATHY_SASL_MECHANISM_GOOGLE,
34 } EmpathySaslMechanism;
35
36 void empathy_sasl_auth_facebook_async (TpChannel *channel,
37     const gchar *client_id,
38     const gchar *access_token,
39     GAsyncReadyCallback callback,
40     gpointer user_data);
41
42 void empathy_sasl_auth_wlm_async (TpChannel *channel,
43     const gchar *access_token,
44     GAsyncReadyCallback callback,
45     gpointer user_data);
46
47 void empathy_sasl_auth_google_async (TpChannel *channel,
48     const gchar *username,
49     const gchar *access_token,
50     GAsyncReadyCallback callback,
51     gpointer user_data);
52
53 gboolean empathy_sasl_auth_finish (TpChannel *channel,
54     GAsyncResult *result,
55     GError **error);
56
57 gboolean empathy_sasl_channel_supports_mechanism (TpChannel *channel,
58     const gchar *mechanism);
59
60 EmpathySaslMechanism empathy_sasl_channel_select_mechanism (TpChannel *channel);
61
62 G_END_DECLS
63
64 #endif /* #ifndef __EMPATHY_SASL_MECHANISMS_H__*/