|
1 |
| ---- |
2 |
| -services: active-directory |
3 |
| -platforms: nodejs |
4 |
| -author: xerners |
5 |
| ---- |
6 |
| - |
7 |
| -# Integrating Azure AD into a NodeJS web application |
8 |
| - |
9 |
| -This Node.js app will give you with a quick and easy way to set up a Web application in node.js with Express using OpenID Connect. The sample server included in the download is designed to run on any platform. |
10 |
| - |
11 |
| -We've released all of the source code for this example in GitHub under an MIT license, so feel free to clone (or even better, fork!) and provide feedback on the forums. |
12 |
| - |
13 |
| - |
14 |
| -## Quick Start |
15 |
| - |
16 |
| -Getting started with the sample is easy. It is configured to run out of the box with minimal setup. |
17 |
| - |
18 |
| -### Step 1: Register an Azure AD Tenant |
19 |
| - |
20 |
| -To use this sample you will need a Azure Active Directory Tenant. If you're not sure what a tenant is or how you would get one, read [What is an Azure AD tenant](http://technet.microsoft.com/library/jj573650.aspx)? or [Sign up for Azure as an organization](http://azure.microsoft.com/documentation/articles/sign-up-organization/). These docs should get you started on your way to using Azure AD. |
21 |
| - |
22 |
| -### Step 2: Download node.js for your platform |
23 |
| - |
24 |
| -To successfully use this sample, you need a working installation of [Node.js](https://nodejs.org/). |
25 |
| - |
26 |
| -### Step 3: Download the Sample application and modules |
27 |
| - |
28 |
| -Next, clone the sample repo and install the project's NPM dependencies. |
| 1 | +# Title |
29 | 2 |
|
30 |
| -From your shell or command line: |
31 |
| - |
32 |
| -* `$ git clone https://github.com/Azure-Samples/active-directory-node-webapp-openidconnect.git` |
33 |
| -* `$ cd active-directory-node-webapp-openidconnect` |
34 |
| -* `$ npm install` |
35 |
| - |
36 |
| -### Step 5: Configure your server using config.js |
37 |
| - |
38 |
| -Provided for simplicity, `config.js` contains some simple variables. In a |
39 |
| -real application, it would be best to use environment variables, a Node.js |
40 |
| -configuration system, or [Azure Key Vault](https://azure.microsoft.com/en-us/services/key-vault/) |
41 |
| -to store credentials securely, outside of your source control system. |
42 |
| - |
43 |
| -In `config.js`, your tenant ID should go in the `realm` configuration field. |
44 |
| - |
45 |
| -**NOTE:** You may also pass the `issuer:` value if you wish to validate that as well. |
46 |
| - |
47 |
| -### Step 6: Run the application |
48 |
| - |
49 |
| -* `$ node app.js` |
50 |
| - |
51 |
| -**Is the server output hard to understand?:** We use `bunyan` for logging in this sample. The console won't make much sense to you unless you also install bunyan and run the server like above but pipe it through the bunyan binary: |
52 |
| - |
53 |
| -* `$ npm install -g bunyan` |
54 |
| -* `$ node app.js | bunyan` |
55 |
| - |
56 |
| -### You're done! |
57 |
| - |
58 |
| -You will have a server successfully running on `http://localhost:3000`. |
59 |
| - |
60 |
| -### Acknowledgements |
| 3 | +--- |
61 | 4 |
|
62 |
| -We would like to acknowledge the folks who own/contribute to the following projects for their support of Azure Active Directory and their libraries that were used to build this sample. In places where we forked these libraries to add additional functionality, we ensured that the chain of forking remains intact so you can navigate back to the original package. Working with such great partners in the open source community clearly illustrates what open collaboration can accomplish. Thank you! |
| 5 | +There's a newer version of this sample taking advantage of the Microsoft identity platform (formerly Azure AD v2.0) |
63 | 6 |
|
64 |
| -## About The Code |
| 7 | +Check it out: [AppModelv2-WebApp-OpenIDConnect-nodejs](https://github.com/azureadquickstarts/appmodelv2-webapp-openidconnect-nodejs) |
65 | 8 |
|
66 |
| -Coming soon... |
| 9 | +If you really need to access this Azure AD v1.0, you can navigate to the master branch, but please know that it's no longer supported. |
0 commit comments