This sample is a proof-of-concept sample that uses the node-outlook module to invoke the Microsoft Office 365 APIs Client Libraries for Cordova Applications from a pure Node.js server app. The client libraries were designed to be run from Cordova-based client apps, so this solution might not work in all situations.
It's assumed that you have Node.js installed before starting.
- Download or fork the sample project.
- Register the app in Azure Active Directory. The app should be registered as a web app with a Sign-on URL of "http://localhost:8000", and should be given permission to "Read and write access to users' mail", "Have full access to users' calendars", and "Have full access to users' contacts". (note these permissions should be added as "Delegated Permissions")
- Edit the
.\clientId.js
file. Copy the client ID for your app obtained during app registration and paste it as the value for theexports.clientId
variable. Copy the key you created during app registration and paste it as the value for theexports.clientSecret
variable. Save the file. - Install all required Node.js modules
npm install
- Start the development server:
npm start
- Use your browser to go to http://127.0.0.1:8000.
- You should now be prompted to connect your Office 365 account. Click the link to do so and login with an Office 365 account.
- You should be redirected to the home page, which should display "Welcome, <Logged in Users's Name>".
- You can use the navigation links at the top of the page to view mail, calendar, or contacts.
Copyright (c) Microsoft. All rights reserved.
Connect with me on Twitter @JasonJohMSFT
Follow the Exchange Dev Blog