-
Notifications
You must be signed in to change notification settings - Fork 9
Understanding the Snippets sample code
This sample demonstrates several concepts including:
- Learn how to make REST calls that target data stored in Office 365 (including Exchange Online and SharePoint Online).
- Understand how to use the Azure Active Directory Authentication Library (ADAL) for JavaScript.
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.
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.