Skip to content
This repository was archived by the owner on Feb 26, 2020. It is now read-only.

Commit 4eb3400

Browse files
committed
Merge branch 'master' into dev
# Conflicts: # node-server/app.js # node-server/config.js
2 parents b63c65f + 6f37dab commit 4eb3400

3 files changed

Lines changed: 11 additions & 16 deletions

File tree

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
#Windows Azure Active Directory Sample REST API Service for Node.js using MongoDB and Restify
22

3-
<<<<<<< HEAD
4-
This Node.js server will give you with a quick and easy way to set up a REST API Service that's integrated with Azure Active Directory for API protection. It uses the OAuth2 protocol with bearer tokens. The sample server included in the download are designed to run on any platform.
5-
=======
63
[![Join the chat at https://gitter.im/AzureADSamples/WebAPI-Nodejs](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/AzureADSamples/WebAPI-Nodejs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
74

8-
This Node.js server will give you with a quick and easy way to set up a REST API Service that's integrated with Windows Azure Active Directory for API protection using the OAuth2 protocol. The sample server included in the download are designed to run on any platform.
9-
>>>>>>> master
5+
This Node.js server will give you with a quick and easy way to set up a REST API Service using the OAuth2 protocol. Then this service is integrated with Azure Active Directory for API protection. The sample server included in the download are designed to run on any platform.
106

117
This REST API server is built using Restify and MongoDB with the following features:
128

@@ -62,7 +58,7 @@ You will need to update the sample to use your values for audienceURI and for th
6258

6359

6460
* `$ cd node-server `
65-
* `$ node server.js`
61+
* `$ node app.js`
6662

6763
**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:
6864

node-server/app.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ function listTasks(req, res, next) {
193193
log.info(data);
194194
}
195195

196-
if (!data.length) {
197-
log.warn(err, "There is no tasks in the database. Did you initalize the database as stated in the README?");
196+
if (!data.length) {
197+
log.warn(err, "There is no tasks in the database. Add one!");
198198
}
199199

200200
if (!owner) {
@@ -331,8 +331,8 @@ var oidcStrategy = new OIDCBearerStrategy(options,
331331
if (!user) {
332332
// "Auto-registration"
333333
log.info('User was added automatically as they were new. Their sub is: ', token.sub);
334-
users.push(token);
335-
owner = token.sub;
334+
users.push(token);
335+
owner = token.sub;
336336
return done(null, token);
337337
}
338338
owner = token.sub;

node-server/config.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Don't commit this file to your public repos. This config is for first-run
2-
exports.creds = {
3-
mongoose_auth_local: 'mongodb://localhost/tasklist', // Your mongo auth uri goes here
4-
issuer: 'https://sts.windows.net/cff56d8f-f602-4afd-94e4-c95b76f1c81e/',
5-
audience: 'http://kidventus.com/TodoListService',
6-
identityMetadata: 'https://login.microsoftonline.com/common/.well-known/openid-configuration' // For using Microsoft you should never need to change this.
7-
};
2+
exports.creds = {
3+
mongoose_auth_local: 'mongodb://localhost/tasklist', // Your mongo auth uri goes here
4+
audience: 'http://localhost:8888/', // the Audience is the App URL when you registered the application.
5+
identityMetadata: 'https://login.microsoftonline.com/common/'
6+
};

0 commit comments

Comments
 (0)