Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Understanding the Snippets sample code

Joe Martella edited this page Nov 18, 2015 · 2 revisions

This sample demonstrates several concepts including:

Connecting to Office 365

The sample provides the code required to display the Office 365 sign in page if there are no tokens available already in the local cache. The sample uses the Azure Active Directory Library for JavaScript to manage the tokens required for the app to use Office 365 services.

The code that uses ADAL JS to authenticate with Azure AD is located in the following files (located in public/):

  • scripts/app.js - The service is configured here.
  • scripts/controllers/navbarController.js - The login/logOut methods exposed by ADAL are leveraged here.

Snippets

This sample is a repository of Microsoft Graph API (previously known as the Office 365 unified API) code snippets that demonstrate how to work with Office 365 objects like mail, calendar, contacts, files, and user profile information.

Each tenant-level resource collection has its own factory defined in public/services where you can see how the requests are constructed. Then the factories are called by mainController.js found in the public/controllers directory.

Clone this wiki locally