Skip to content
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.

Integration with Office 365

Alina Popa edited this page Jan 31, 2016 · 1 revision

Integration with Office 365

The Office 365 integration allows the patient to find available appointment spots in the doctor's Office 365 calendar; when a new appointment is created from the patient app, it will appear in both the patient's calendar and in the doctor's calendar. This is done using Microsoft Graph API. You can watch an introduction to Microsoft Graph API in this Connect(); [video] (https://channel9.msdn.com/Events/Visual-Studio/Connect-event-2015/301).

The web app can access all doctors' Office 365 calendars. The patient app (iOS and Android Xamarin apps; the UWP patient app in this sample is not integrated with Office 365) can access the patient Office 365 calendar. The patient app gets the doctor availability info from the web app. When a new appointment is created, the patient app updates the patient calendar, and the web app updates the doctor's calendar.

To set up the integration with Office 365, the web app (ASP.NET app) must be added to Azure Active Directory through the Azure Portal and authorizations configured; the mobile apps (iOS and Android app) must be registered to Active Directory at https://apps.dev.microsoft.com. Use the Azure Portal to [register the web application] (https://azure.microsoft.com/en-us/documentation/articles/mobile-services-how-to-register-active-directory-authentication/#registering-your-app) in Azure Active Directory under your Organization. From Azure Portal, configure the application's permissions: go to Configure tab, then Permissions to other applications > Add Application > Microsoft Graph. Under Application Permissions check Read calendars in all mailboxes. Read the following [documentation] (https://msdn.microsoft.com/en-us/office/office365/howto/building-service-apps-in-office-365) to learn how to create a certificate and access token for the application. Add the certificate (.pfx file) under folder src\MyHealth.Web\content. In src\MyHealth.Web\appsettings.json, set the "ClientCertificatePfx" value to your certificate file name. Also in the same appsettings.json file, set "ClientId" to the value you get from Azure Portal. Create a key in Azure Portal and fill the "ClientKey" value in json file. Also fill the values for "ClientCertificatePassword" and "DebugTenantId".

User the following [link] (https://azure.microsoft.com/en-us/documentation/articles/active-directory-v2-app-registration/) for instructions to register the iOS and Android application to Azure Directory. Then fill the DroidClientId and iOSClientId in file src\MyHealth.Client.Core\AppSettings.cs with the ID's obtained at registration. Replace the RedirectUri in the same file if needed.