|
| 1 | +# How to run the completed project |
| 2 | + |
| 3 | +## Prerequisites |
| 4 | + |
| 5 | +To run the completed project in this folder, you need the following: |
| 6 | + |
| 7 | +- [Node.js](https://nodejs.org) installed on your development machine. If you do not have Node.js, visit the previous link for download options. (**Note:** This tutorial was written with Node version 10.7.0. The steps in this guide may work with other versions, but that has not been tested.) |
| 8 | +- [Angular CLI](https://cli.angular.io/) installed on your development machine. |
| 9 | +- Either a personal Microsoft account with a mailbox on Outlook.com, or a Microsoft work or school account. |
| 10 | + |
| 11 | +If you don't have a Microsoft account, there are a couple of options to get a free account: |
| 12 | + |
| 13 | +- You can [sign up for a new personal Microsoft account](https://signup.live.com/signup?wa=wsignin1.0&rpsnv=12&ct=1454618383&rver=6.4.6456.0&wp=MBI_SSL_SHARED&wreply=https://mail.live.com/default.aspx&id=64855&cbcxt=mai&bk=1454618383&uiflavor=web&uaid=b213a65b4fdc484382b6622b3ecaa547&mkt=E-US&lc=1033&lic=1). |
| 14 | +- You can [sign up for the Office 365 Developer Program](https://developer.microsoft.com/office/dev-program) to get a free Office 365 subscription. |
| 15 | + |
| 16 | +## Register a web application with the Azure Active Directory admin center |
| 17 | + |
| 18 | +1. Open a browser and navigate to the [Azure Active Directory admin center](https://aad.portal.azure.com). Login using a **personal account** (aka: Microsoft Account) or **Work or School Account**. |
| 19 | + |
| 20 | +1. Select **Azure Active Directory** in the left-hand navigation, then select **App registrations** under **Manage**. |
| 21 | + |
| 22 | +  |
| 23 | + |
| 24 | +1. Select **New registration**. On the **Register an application** page, set the values as follows. |
| 25 | + |
| 26 | + - Set **Name** to `Angular Graph Tutorial`. |
| 27 | + - Set **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts**. |
| 28 | + - Under **Redirect URI**, set the first drop-down to `Web` and set the value to `http://localhost:4200`. |
| 29 | + |
| 30 | +  |
| 31 | + |
| 32 | +1. Choose **Register**. On the **Angular Graph Tutorial** page, copy the value of the **Application (client) ID** and save it, you will need it in the next step. |
| 33 | + |
| 34 | +  |
| 35 | + |
| 36 | +1. Select **Authentication** under **Manage**. Locate the **Implicit grant** section and enable **Access tokens** and **ID tokens**. Choose **Save**. |
| 37 | + |
| 38 | +  |
| 39 | + |
| 40 | +## Configure the sample |
| 41 | + |
| 42 | +1. Rename the `oauth.ts.example` file to `oauth.ts`. |
| 43 | +1. Edit the `oauth.ts` file and make the following changes. |
| 44 | + 1. Replace `YOUR_APP_ID_HERE` with the **Application Id** you got from the App Registration Portal. |
| 45 | +1. In your command-line interface (CLI), navigate to this directory and run the following command to install requirements. |
| 46 | + |
| 47 | + ```Shell |
| 48 | + npm install |
| 49 | + ``` |
| 50 | + |
| 51 | +## Run the sample |
| 52 | + |
| 53 | +1. Run the following command in your CLI to start the application. |
| 54 | + |
| 55 | + ```Shell |
| 56 | + ng serve |
| 57 | + ``` |
| 58 | + |
| 59 | +1. Open a browser and browse to `http://localhost:4200`. |
0 commit comments