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,14 @@ 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
+
1. In the list of pages for the app, select **Manifest**.
55
+
- Find the key `logoutUrl` and replace its value with `http://localhost:3000/logout` (:warning:)
56
+
- Select **Save**
57
+
58
+
> :warning: Except on localhost, HTTP schemes are considered insecure and should not be used. In production, you should use HTTPS instead. See for more: [Microsoft identity platform best practices and recommendations](https://docs.microsoft.com/azure/active-directory/develop/identity-platform-integration-checklist#security)
53
59
54
60
1. Select **Save**.
55
61
@@ -60,7 +66,6 @@ To run this sample you will need the following:
60
66
61
67
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
68
63
-
64
69
## Download the sample application and modules
65
70
66
71
Next, clone the sample repo and install the NPM modules.
@@ -105,16 +109,15 @@ The default session store in this sample is `express-session`. Note that the def
105
109
106
110
* Run the app using the following command from your command line.
107
111
108
-
```
109
-
$ node app.js
112
+
```console
113
+
node app.js
110
114
```
111
115
112
116
**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
117
114
-
```
115
-
$ npm install -g bunyan
116
-
117
-
$ node app.js | bunyan
118
+
```console
119
+
npm install -g bunyan
120
+
node app.js | bunyan
118
121
```
119
122
120
123
### You're done!
@@ -133,15 +136,15 @@ For issues with the passport-azure-ad library, please raise the issue on the lib
133
136
134
137
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
138
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.
139
+
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
140
138
141
## Security Library
139
142
140
143
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
144
142
145
## Security Reporting
143
146
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.
147
+
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
148
146
149
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License (the "License");
0 commit comments