diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b607d3..70e25ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -173,6 +173,22 @@ if(ENABLE_TESTS)
 	pkg_check_modules_for_option(ENABLE_TESTS "low level tests" UHTTPMOCK libuhttpmock-0.0)
 endif(ENABLE_TESTS)
 
+# ******************************
+# Office365 OAuth2 support
+# ******************************
+
+add_printable_variable(WITH_OFFICE365_CLIENT_ID "Office365.com OAuth 2.0 client id" "")
+add_printable_variable(WITH_OFFICE365_CLIENT_SECRET "Office365.com OAuth 2.0 client secret" "")
+
+if(WITH_OFFICE365_CLIENT_ID STREQUAL "")
+	set(WITH_OFFICE365_CLIENT_ID "cc6e0693-0e26-4220-8322-9d363e308fc6")
+endif(WITH_OFFICE365_CLIENT_ID STREQUAL "")
+
+# Office365.com requires client secret only for Web applications
+#if(WITH_OFFICE365_CLIENT_SECRET STREQUAL "")
+#	set(WITH_OFFICE365_CLIENT_SECRET "")
+#endif(WITH_OFFICE365_CLIENT_SECRET STREQUAL "")
+
 # ******************************
 # Special directories
 # ******************************
diff --git a/config.h.in b/config.h.in
index 20f57d9..2b41bd9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -20,3 +20,9 @@
 
 /* libmspack has OAB support */
 #cmakedefine WITH_MSPACK 1
+
+/* Define Office365 OAuth 2.0 Client ID to use */
+#define OFFICE365_CLIENT_ID "@WITH_OFFICE365_CLIENT_ID@"
+
+/* Define Office365 OAuth 2.0 Client Secret to use */
+#define OFFICE365_CLIENT_SECRET "@WITH_OFFICE365_CLIENT_SECRET@"
diff --git a/po/POTFILES.in b/po/POTFILES.in
index a4271db..9404686 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -24,6 +24,8 @@ src/configuration/e-mail-config-ews-folder-sizes-page.c
 src/configuration/e-mail-config-ews-gal.c
 src/configuration/e-mail-config-ews-ooo-page.c
 src/configuration/module-ews-configuration.error.xml
+src/server/camel-sasl-xoauth2-office365.c
 src/server/e-ews-camel-common.c
 src/server/e-ews-connection.c
 src/server/e-ews-folder.c
+src/server/e-oauth2-service-office365.c
diff --git a/src/addressbook/e-book-backend-ews-factory.c b/src/addressbook/e-book-backend-ews-factory.c
index d91a7da..1710085 100644
--- a/src/addressbook/e-book-backend-ews-factory.c
+++ b/src/addressbook/e-book-backend-ews-factory.c
@@ -27,6 +27,7 @@
 
 #include <libedata-book/libedata-book.h>
 
+#include "server/e-oauth2-service-office365.h"
 #include "server/e-source-ews-folder.h"
 
 #include "e-book-backend-ews.h"
@@ -80,6 +81,7 @@ e_module_load (GTypeModule *type_module)
 	e_module = E_MODULE (type_module);
 
 	e_source_ews_folder_type_register (type_module);
+	e_oauth2_service_office365_type_register (type_module);
 
 	e_book_backend_ews_factory_register_type (type_module);
 }
diff --git a/src/calendar/e-cal-backend-ews-factory.c b/src/calendar/e-cal-backend-ews-factory.c
index 2f4b979..7f176fd 100644
--- a/src/calendar/e-cal-backend-ews-factory.c
+++ b/src/calendar/e-cal-backend-ews-factory.c
@@ -12,6 +12,7 @@
 
 #include <libedata-cal/libedata-cal.h>
 
+#include "server/e-oauth2-service-office365.h"
 #include "server/e-source-ews-folder.h"
 
 #include "e-cal-backend-ews.h"
@@ -134,6 +135,7 @@ e_module_load (GTypeModule *type_module)
 	e_module = E_MODULE (type_module);
 
 	e_source_ews_folder_type_register (type_module);
+	e_oauth2_service_office365_type_register (type_module);
 
 	e_cal_backend_ews_events_factory_register_type (type_module);
 	e_cal_backend_ews_journal_factory_register_type (type_module);
diff --git a/src/camel/camel-ews-provider.c b/src/camel/camel-ews-provider.c
index 3b47b89..56878dc 100644
--- a/src/camel/camel-ews-provider.c
+++ b/src/camel/camel-ews-provider.c
@@ -31,6 +31,8 @@
 #include <glib/gi18n-lib.h>
 #include <gmodule.h>
 
+#include "server/camel-sasl-xoauth2-office365.h"
+
 #include "camel-ews-store.h"
 #include "camel-ews-transport.h"
 
@@ -139,6 +141,8 @@ camel_provider_module_init (void)
 	bindtextdomain (GETTEXT_PACKAGE, EXCHANGE_EWS_LOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 
+	g_type_ensure (CAMEL_TYPE_SASL_XOAUTH2_OFFICE365);
+
 	camel_provider_register (&ews_provider);
 }
 
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index 66cd7cf..c3d702d 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -2016,6 +2016,16 @@ ews_store_query_auth_types_sync (CamelService *service,
 				auth = "PLAIN";
 			else if (g_ascii_strcasecmp (auth, "Negotiate") == 0)
 				auth = "GSSAPI";
+			else if (e_oauth2_services_is_supported () &&
+				 g_ascii_strcasecmp (auth, "Bearer") == 0) {
+				/* Use Camel name for OAuth2. It's up to the caller to decide whether
+				   it can be used or not. */
+				authtype = camel_sasl_authtype ("XOAUTH2");
+				if (authtype)
+					auth_types = g_list_prepend (auth_types, authtype);
+
+				continue;
+			}
 
 			for (siter = provider->authtypes; siter; siter = siter->next) {
 				authtype = siter->data;
diff --git a/src/collection/module-ews-backend.c b/src/collection/module-ews-backend.c
index 8bfac43..6f63634 100644
--- a/src/collection/module-ews-backend.c
+++ b/src/collection/module-ews-backend.c
@@ -20,6 +20,7 @@
 
 #include <glib/gi18n-lib.h>
 
+#include "server/e-oauth2-service-office365.h"
 #include "server/e-source-ews-folder.h"
 
 #include "e-ews-backend.h"
@@ -37,6 +38,7 @@ e_module_load (GTypeModule *type_module)
 
 	e_ews_backend_type_register (type_module);
 	e_ews_backend_factory_type_register (type_module);
+	e_oauth2_service_office365_type_register (type_module);
 
 	e_source_ews_folder_type_register (type_module);
 }
diff --git a/src/configuration/module-ews-configuration.c b/src/configuration/module-ews-configuration.c
index ca43f4d..818daf0 100644
--- a/src/configuration/module-ews-configuration.c
+++ b/src/configuration/module-ews-configuration.c
@@ -36,6 +36,8 @@
 #include "e-ews-photo-source.h"
 
 #include "e-ews-config-ui-extension.h"
+#include "server/camel-sasl-xoauth2-office365.h"
+#include "server/e-oauth2-service-office365.h"
 #include "server/e-source-ews-folder.h"
 
 /* Module Entry Points */
@@ -63,6 +65,8 @@ e_module_load (GTypeModule *type_module)
 	e_ews_config_ui_extension_type_register (type_module);
 	e_ews_ooo_notificator_type_register (type_module);
 	e_ews_photo_source_type_register (type_module);
+	camel_sasl_xoauth2_office365_type_register (type_module);
+	e_oauth2_service_office365_type_register (type_module);
 
 	e_source_ews_folder_type_register (type_module);
 }
diff --git a/src/server/CMakeLists.txt b/src/server/CMakeLists.txt
index 8ce6c4e..a6ed430 100644
--- a/src/server/CMakeLists.txt
+++ b/src/server/CMakeLists.txt
@@ -3,6 +3,8 @@ glib_mkenums(e-ews-enumtypes e-ews-enums.h E_EWS_ENUMTYPES_H)
 set(SOURCES
 	camel-ews-settings.c
 	camel-ews-settings.h
+	camel-sasl-xoauth2-office365.c
+	camel-sasl-xoauth2-office365.h
 	e-ews-calendar-utils.c
 	e-ews-calendar-utils.h
 	e-ews-camel-common.c
@@ -26,6 +28,8 @@ set(SOURCES
 	e-ews-oof-settings.c
 	e-ews-query-to-restriction.c
 	e-ews-query-to-restriction.h
+	e-oauth2-service-office365.c
+	e-oauth2-service-office365.h
 	e-soup-auth-negotiate.c
 	e-soup-auth-negotiate.h
 	e-soap-message.c
diff --git a/src/server/camel-sasl-xoauth2-office365.c b/src/server/camel-sasl-xoauth2-office365.c
new file mode 100644
index 0000000..8df8ddc
--- /dev/null
+++ b/src/server/camel-sasl-xoauth2-office365.c
@@ -0,0 +1,55 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "evolution-ews-config.h"
+
+#include <glib/gi18n-lib.h>
+
+#include "camel-sasl-xoauth2-office365.h"
+
+static CamelServiceAuthType sasl_xoauth2_office365_auth_type = {
+	N_("OAuth2 (Office365)"),
+	N_("This option will use an OAuth 2.0 "
+	   "access token to connect to the Office365.com server"),
+	"Office365",
+	FALSE
+};
+
+G_DEFINE_DYNAMIC_TYPE (CamelSaslXOAuth2Office365, camel_sasl_xoauth2_office365, CAMEL_TYPE_SASL_XOAUTH2)
+
+static void
+camel_sasl_xoauth2_office365_class_init (CamelSaslXOAuth2Office365Class *klass)
+{
+	CamelSaslClass *sasl_class;
+
+	sasl_class = CAMEL_SASL_CLASS (klass);
+	sasl_class->auth_type = &sasl_xoauth2_office365_auth_type;
+}
+
+static void
+camel_sasl_xoauth2_office365_class_finalize (CamelSaslXOAuth2Office365Class *klass)
+{
+}
+
+static void
+camel_sasl_xoauth2_office365_init (CamelSaslXOAuth2Office365 *sasl)
+{
+}
+
+void
+camel_sasl_xoauth2_office365_type_register (GTypeModule *type_module)
+{
+	camel_sasl_xoauth2_office365_register_type (type_module);
+}
diff --git a/src/server/camel-sasl-xoauth2-office365.h b/src/server/camel-sasl-xoauth2-office365.h
new file mode 100644
index 0000000..8cb3135
--- /dev/null
+++ b/src/server/camel-sasl-xoauth2-office365.h
@@ -0,0 +1,63 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef CAMEL_SASL_XOAUTH2_OFFICE365_H
+#define CAMEL_SASL_XOAUTH2_OFFICE365_H
+
+#include <gmodule.h>
+#include <camel/camel.h>
+
+/* Standard GObject macros */
+#define CAMEL_TYPE_SASL_XOAUTH2_OFFICE365 \
+	(camel_sasl_xoauth2_office365_get_type ())
+#define CAMEL_SASL_XOAUTH2_OFFICE365(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), CAMEL_TYPE_SASL_XOAUTH2_OFFICE365, CamelSaslXOAuth2Office365))
+#define CAMEL_SASL_XOAUTH2_OFFICE365_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), CAMEL_TYPE_SASL_XOAUTH2_OFFICE365, CamelSaslXOAuth2Office365Class))
+#define CAMEL_IS_SASL_XOAUTH2_OFFICE365(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), CAMEL_TYPE_SASL_XOAUTH2_OFFICE365))
+#define CAMEL_IS_SASL_XOAUTH2_OFFICE365_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), CAMEL_TYPE_SASL_XOAUTH2_OFFICE365))
+#define CAMEL_SASL_XOAUTH2_OFFICE365_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), CAMEL_TYPE_SASL_XOAUTH2_OFFICE365, CamelSaslXOAuth2Office365Class))
+
+G_BEGIN_DECLS
+
+typedef struct _CamelSaslXOAuth2Office365 CamelSaslXOAuth2Office365;
+typedef struct _CamelSaslXOAuth2Office365Class CamelSaslXOAuth2Office365Class;
+typedef struct _CamelSaslXOAuth2Office365Private CamelSaslXOAuth2Office365Private;
+
+struct _CamelSaslXOAuth2Office365 {
+	CamelSaslXOAuth2 parent;
+	CamelSaslXOAuth2Office365Private *priv;
+};
+
+struct _CamelSaslXOAuth2Office365Class {
+	CamelSaslXOAuth2Class parent_class;
+};
+
+GType		camel_sasl_xoauth2_office365_get_type	(void) G_GNUC_CONST;
+
+void		camel_sasl_xoauth2_office365_type_register
+							(GTypeModule *type_module);
+
+G_END_DECLS
+
+#endif /* CAMEL_SASL_XOAUTH2_OFFICE365_H */
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 8daf945..9d3f743 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -9582,6 +9582,7 @@ ews_connection_gather_auth_methods_cb (SoupMessage *message,
 {
 	EwsAsyncData *async_data;
 	const gchar *auths_lst;
+	gboolean has_bearer = FALSE;
 	gchar **auths;
 	gint ii;
 
@@ -9603,6 +9604,7 @@ ews_connection_gather_auth_methods_cb (SoupMessage *message,
 			if (space)
 				*space = '\0';
 
+			has_bearer = has_bearer || g_ascii_strcasecmp (auth, "Bearer") == 0;
 			async_data->items = g_slist_prepend (async_data->items, auth);
 		} else {
 			g_free (auth);
@@ -9611,6 +9613,17 @@ ews_connection_gather_auth_methods_cb (SoupMessage *message,
 
 	g_strfreev (auths);
 
+	if (!has_bearer) {
+		/* Special-case Office365 OAuth2, because outlook.office365.com doesn't advertise Bearer */
+		SoupURI *suri;
+
+		suri = soup_message_get_uri (message);
+		if (suri && soup_uri_get_host (suri) &&
+		    g_ascii_strcasecmp (soup_uri_get_host (suri), "outlook.office365.com") == 0) {
+			async_data->items = g_slist_prepend (async_data->items, g_strdup ("Bearer"));
+		}
+	}
+
 	g_object_set_data (G_OBJECT (simple), EWS_OBJECT_KEY_AUTHS_GATHERED, GINT_TO_POINTER (1));
 
 	soup_message_set_status_full (message, SOUP_STATUS_CANCELLED, "EWS auths gathered");
diff --git a/src/server/e-oauth2-service-office365.c b/src/server/e-oauth2-service-office365.c
new file mode 100644
index 0000000..0bef693
--- /dev/null
+++ b/src/server/e-oauth2-service-office365.c
@@ -0,0 +1,208 @@
+/*
+ * Copyright (C) 2018 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "evolution-ews-config.h"
+
+#include <glib/gi18n-lib.h>
+#include <libedataserver/libedataserver.h>
+
+#include "e-oauth2-service-office365.h"
+
+/* https://portal.azure.com/
+   https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-developers-guide
+   https://tsmatz.wordpress.com/2016/10/07/application-permission-with-v2-endpoint-and-microsoft-graph/
+*/
+
+#define OFFICE365_SCOPE "offline_access " \
+	"https://outlook.office.com/Mail.ReadWrite " \
+	"https://outlook.office.com/Mail.Send " \
+	"https://outlook.office.com/Calendars.ReadWrite " \
+	"https://outlook.office.com/Contacts.ReadWrite " \
+	"https://outlook.office.com/Tasks.ReadWrite"
+
+	/*"https://outlook.office.com/Mail.ReadWrite.Shared " \
+	"https://outlook.office.com/Mail.Send.Shared " \
+	"https://outlook.office.com/Calendars.ReadWrite.Shared " \
+	"https://outlook.office.com/Contacts.ReadWrite.Shared " \
+	"https://outlook.office.com/Tasks.ReadWrite.Shared"*/
+
+/* Forward Declarations */
+static void e_oauth2_service_office365_oauth2_service_init (EOAuth2ServiceInterface *iface);
+
+G_DEFINE_DYNAMIC_TYPE_EXTENDED (EOAuth2ServiceOffice365, e_oauth2_service_office365, E_TYPE_OAUTH2_SERVICE_BASE, 0,
+	G_IMPLEMENT_INTERFACE_DYNAMIC (E_TYPE_OAUTH2_SERVICE, e_oauth2_service_office365_oauth2_service_init))
+
+static gboolean
+eos_office365_guess_can_process (EOAuth2Service *service,
+				 const gchar *protocol,
+				 const gchar *hostname)
+{
+	return e_oauth2_services_is_supported () &&
+		protocol && g_ascii_strcasecmp (protocol, "ews") == 0 &&
+		hostname && e_util_utf8_strstrcase (hostname, "outlook.office365.com");
+}
+
+static const gchar *
+eos_office365_get_name (EOAuth2Service *service)
+{
+	return "Office365";
+}
+
+static const gchar *
+eos_office365_get_display_name (EOAuth2Service *service)
+{
+	/* Translators: This is a user-visible string, display name of an OAuth2 service. */
+	return C_("OAuth2Service", "Office365");
+}
+
+static const gchar *
+eos_office365_get_client_id (EOAuth2Service *service)
+{
+	return OFFICE365_CLIENT_ID;
+}
+
+static const gchar *
+eos_office365_get_client_secret (EOAuth2Service *service)
+{
+	const gchar *secret = OFFICE365_CLIENT_SECRET;
+
+	if (secret && !*secret)
+		return NULL;
+
+	return secret;
+}
+
+static const gchar *
+eos_office365_get_authentication_uri (EOAuth2Service *service)
+{
+	return "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
+}
+
+static const gchar *
+eos_office365_get_refresh_uri (EOAuth2Service *service)
+{
+	return "https://login.microsoftonline.com/common/oauth2/v2.0/token";
+}
+
+static const gchar *
+eos_office365_get_redirect_uri (EOAuth2Service *service)
+{
+	return "https://login.microsoftonline.com/common/oauth2/nativeclient";
+}
+
+static void
+eos_office365_prepare_authentication_uri_query (EOAuth2Service *service,
+						ESource *source,
+						GHashTable *uri_query)
+{
+	g_return_if_fail (uri_query != NULL);
+
+	e_oauth2_service_util_set_to_form (uri_query, "response_mode", "query");
+	e_oauth2_service_util_set_to_form (uri_query, "scope", OFFICE365_SCOPE);
+}
+
+static gboolean
+eos_office365_extract_authorization_code (EOAuth2Service *service,
+					  const gchar *page_title,
+					  const gchar *page_uri,
+					  const gchar *page_content,
+					  gchar **out_authorization_code)
+{
+	SoupURI *suri;
+	gboolean known = FALSE;
+
+	g_return_val_if_fail (out_authorization_code != NULL, FALSE);
+
+	*out_authorization_code = NULL;
+
+	if (!page_uri || !*page_uri)
+		return FALSE;
+
+	suri = soup_uri_new (page_uri);
+	if (!suri)
+		return FALSE;
+
+	if (suri->query) {
+		GHashTable *uri_query = soup_form_decode (suri->query);
+
+		if (uri_query) {
+			const gchar *code;
+
+			code = g_hash_table_lookup (uri_query, "code");
+
+			if (code && *code) {
+				*out_authorization_code = g_strdup (code);
+				known = TRUE;
+			} else if (g_hash_table_lookup (uri_query, "error")) {
+				known = TRUE;
+			}
+
+			g_hash_table_unref (uri_query);
+		}
+	}
+
+	soup_uri_free (suri);
+
+	return known;
+}
+
+static void
+eos_office365_prepare_refresh_token_form (EOAuth2Service *service,
+					  const gchar *refresh_token,
+					  GHashTable *form)
+{
+	g_return_if_fail (form != NULL);
+
+	e_oauth2_service_util_set_to_form (form, "scope", OFFICE365_SCOPE);
+	e_oauth2_service_util_set_to_form (form, "redirect_uri", e_oauth2_service_get_redirect_uri (service));
+}
+
+static void
+e_oauth2_service_office365_oauth2_service_init (EOAuth2ServiceInterface *iface)
+{
+	iface->guess_can_process = eos_office365_guess_can_process;
+	iface->get_name = eos_office365_get_name;
+	iface->get_display_name = eos_office365_get_display_name;
+	iface->get_client_id = eos_office365_get_client_id;
+	iface->get_client_secret = eos_office365_get_client_secret;
+	iface->get_authentication_uri = eos_office365_get_authentication_uri;
+	iface->get_refresh_uri = eos_office365_get_refresh_uri;
+	iface->get_redirect_uri = eos_office365_get_redirect_uri;
+	iface->prepare_authentication_uri_query = eos_office365_prepare_authentication_uri_query;
+	iface->extract_authorization_code = eos_office365_extract_authorization_code;
+	iface->prepare_refresh_token_form = eos_office365_prepare_refresh_token_form;
+}
+
+static void
+e_oauth2_service_office365_class_init (EOAuth2ServiceOffice365Class *klass)
+{
+}
+
+static void
+e_oauth2_service_office365_class_finalize (EOAuth2ServiceOffice365Class *klass)
+{
+}
+
+static void
+e_oauth2_service_office365_init (EOAuth2ServiceOffice365 *oauth2_office365)
+{
+}
+
+void
+e_oauth2_service_office365_type_register (GTypeModule *type_module)
+{
+	e_oauth2_service_office365_register_type (type_module);
+}
diff --git a/src/server/e-oauth2-service-office365.h b/src/server/e-oauth2-service-office365.h
new file mode 100644
index 0000000..3344c98
--- /dev/null
+++ b/src/server/e-oauth2-service-office365.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2018 Red Hat, Inc. (www.redhat.com)
+ *
+ * This library is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef E_OAUTH2_SERVICE_OFFICE365_H
+#define E_OAUTH2_SERVICE_OFFICE365_H
+
+#include <gmodule.h>
+#include <libedataserver/libedataserver.h>
+
+/* Standard GObject macros */
+#define E_TYPE_OAUTH2_SERVICE_OFFICE365 \
+	(e_oauth2_service_office365_get_type ())
+#define E_OAUTH2_SERVICE_OFFICE365(obj) \
+	(G_TYPE_CHECK_INSTANCE_CAST \
+	((obj), E_TYPE_OAUTH2_SERVICE_OFFICE365, EOAuth2ServiceOffice365))
+#define E_OAUTH2_SERVICE_OFFICE365_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_CAST \
+	((cls), E_TYPE_OAUTH2_SERVICE_OFFICE365, EOAuth2ServiceOffice365Class))
+#define E_IS_OAUTH2_SERVICE_OFFICE365(obj) \
+	(G_TYPE_CHECK_INSTANCE_TYPE \
+	((obj), E_TYPE_OAUTH2_SERVICE_OFFICE365))
+#define E_IS_OAUTH2_SERVICE_OFFICE365_CLASS(cls) \
+	(G_TYPE_CHECK_CLASS_TYPE \
+	((cls), E_TYPE_OAUTH2_SERVICE_OFFICE365))
+#define E_OAUTH2_SERVICE_OFFICE365_GET_CLASS(obj) \
+	(G_TYPE_INSTANCE_GET_CLASS \
+	((obj), E_TYPE_OAUTH2_SERVICE_OFFICE365, EOAuth2ServiceOffice365Class))
+
+G_BEGIN_DECLS
+
+typedef struct _EOAuth2ServiceOffice365 EOAuth2ServiceOffice365;
+typedef struct _EOAuth2ServiceOffice365Class EOAuth2ServiceOffice365Class;
+
+struct _EOAuth2ServiceOffice365 {
+	EOAuth2ServiceBase parent;
+};
+
+struct _EOAuth2ServiceOffice365Class {
+	EOAuth2ServiceBaseClass parent_class;
+};
+
+GType		e_oauth2_service_office365_get_type	(void) G_GNUC_CONST;
+
+void		e_oauth2_service_office365_type_register
+							(GTypeModule *type_module);
+
+G_END_DECLS
+
+#endif /* E_OAUTH2_SERVICE_OFFICE365_H */
