You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sample demonstrates how to set up OpenId Connect authentication in a web application built using Node.js with Express. The sample is designed to run on any platform.
@@ -21,7 +22,7 @@ To run this sample you will need the following:
21
22
22
23
* Install Node.js from http://nodejs.org/
23
24
24
-
* Either a [Microsoft account](https://www.outlook.com) or [Office 365 for business account](https://msdn.microsoft.com/en-us/office/office365/howto/setup-development-environment#bk_Office365Account)
25
+
* Either a [Microsoft account](https://www.outlook.com) or [Office 365 for business account](https://msdn.microsoft.com/office/office365/howto/setup-development-environment#bk_Office365Account)
25
26
26
27
## Register the sample
27
28
@@ -47,9 +48,17 @@ To run this sample you will need the following:
47
48
48
49
1. In the list of pages for the app, select **Authentication**.
49
50
- In the **Redirect URIs** section, select **Web** in the combo-box and enter the following redirect URI:
50
-
`http://localhost:3000/auth/openid/return`
51
-
- In the **Advanced settings** section, set **Logout URL** to `http://localhost:3000`.
52
-
- In the **Advanced settings > Implicit grant** section, check **ID tokens** as this sample requires the [Implicit grant flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow) to be enabled to sign-in the user.
- In the **Advanced settings > Implicit grant and hybrid flows** section, check **ID tokens** as this sample requires the [hybrid flow](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-implicit-grant-flow) to be enabled to sign-in the user.
53
+
- Select **Save**.
54
+
55
+
> :warning: In this tutorial sample, we use HTTP schemes as the application runs on locahost only. However, HTTP schemes are insecure and should not be used in production.
56
+
57
+
1. In the list of pages for the app, select **Manifest**.
58
+
- Find the key `logoutUrl` and replace its value with `http://localhost:3000/logout` (:warning:)
59
+
- Select **Save**
60
+
61
+
> :warning: In this tutorial sample, we use HTTP schemes as the application runs on locahost only. However, HTTP schemes are insecure and should not be used in production.
53
62
54
63
1. Select **Save**.
55
64
@@ -60,7 +69,6 @@ To run this sample you will need the following:
60
69
61
70
You'll need this key later to configure the application. This key value will not be displayed again, nor retrievable by any other means, so record it as soon as it is visible from the Azure portal.
62
71
63
-
64
72
## Download the sample application and modules
65
73
66
74
Next, clone the sample repo and install the NPM modules.
@@ -105,16 +112,15 @@ The default session store in this sample is `express-session`. Note that the def
105
112
106
113
* Run the app using the following command from your command line.
107
114
108
-
```
109
-
$ node app.js
115
+
```console
116
+
node app.js
110
117
```
111
118
112
119
**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:
113
120
114
-
```
115
-
$ npm install -g bunyan
116
-
117
-
$ node app.js | bunyan
121
+
```console
122
+
npm install -g bunyan
123
+
node app.js | bunyan
118
124
```
119
125
120
126
### You're done!
@@ -133,15 +139,15 @@ For issues with the passport-azure-ad library, please raise the issue on the lib
133
139
134
140
If you'd like to contribute to this sample, please follow the [GitHub Fork and Pull request model](https://help.github.com/articles/fork-a-repo/).
135
141
136
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
142
+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
137
143
138
144
## Security Library
139
145
140
146
This library controls how users sign-in and access services. We recommend you always take the latest version of our library in your app when possible.
141
147
142
148
## Security Reporting
143
149
144
-
If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/en-us/security/dd252948) and subscribing to Security Advisory Alerts.
150
+
If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://technet.microsoft.com/security/dd252948) and subscribing to Security Advisory Alerts.
145
151
146
152
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
0 commit comments