From 4ac581f66d5596fc05f7711c1bac2f85bbc19f04 Mon Sep 17 00:00:00 2001 From: Jeff Wilcox Date: Sun, 31 Jul 2016 23:44:36 -0700 Subject: [PATCH 1/7] Simplified package license property --- package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 7758a92..f960f1b 100644 --- a/package.json +++ b/package.json @@ -5,12 +5,7 @@ "email": "msopentech@microsoft.com", "url": "http://msopentech.com/" }, - "licenses": [ - { - "type": "Apache 2.0", - "url": "https://github.com/AzureAD/aal/raw/master/License.txt" - } - ], + "license": "Apache-2.0", "repository": { "type": "git", "url": "https://github.com/AzureAD/azure-activedirectory-library-for-nodejs.git" From fe6daa1f477988377b4b7dde4e8b1e07e08ebab2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20In=C3=A9s=20Parnisari?= Date: Sat, 15 Apr 2017 19:54:59 -0300 Subject: [PATCH 2/7] Update README.md Updated link to samples. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8e00ddf..7fb75e4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ You can find the changes for each version in the [change log](https://github.com ## Samples and Documentation -[We provide a full suite of sample applications and documentation on GitHub](https://github.com/AzureADSamples) to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, OSX, Android, and Linux. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect, Graph API, and other awesome features. +[We provide a full suite of sample applications and documentation on GitHub](https://github.com/azure-samples?q=active-directory) to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, OSX, Android, and Linux. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect, Graph API, and other awesome features. ## Community Help and Support From 7588f96eb6ee42f3d950954d4576ae9b9de429b0 Mon Sep 17 00:00:00 2001 From: Akos Sebestyen Date: Tue, 30 May 2017 11:19:23 -0700 Subject: [PATCH 3/7] remove need for dynamic access to package.json to obtain lib version --- lib/util.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/util.js b/lib/util.js index 6665453..f5d1333 100644 --- a/lib/util.js +++ b/lib/util.js @@ -22,7 +22,6 @@ var _ = require('underscore'); var adalIdConstants = require('./constants').AdalIdParameters; -var fs = require('fs'); var os = require('os'); var url = require('url'); @@ -34,9 +33,7 @@ var ADAL_VERSION; */ function loadAdalVersion() { - var packageData = fs.readFileSync(__dirname + '/../package.json'); - var packageJson = JSON.parse(packageData); - ADAL_VERSION = packageJson.version; + ADAL_VERSION = require('../package.json').version; } function adalInit() { From c8de325dc5331fb3f91d768897ec340d9615c277 Mon Sep 17 00:00:00 2001 From: Wesley Yao Date: Fri, 25 Aug 2017 19:27:31 -0700 Subject: [PATCH 4/7] add windows graph sample --- sample/package.json | 1 + sample/windows-graph-sample.js | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 sample/windows-graph-sample.js diff --git a/sample/package.json b/sample/package.json index 5c1cc4e..fef34ea 100644 --- a/sample/package.json +++ b/sample/package.json @@ -3,6 +3,7 @@ , "version": "0.0.1" , "private": true , "dependencies": { + "@microsoft/microsoft-graph-client": "^1.0.0", "adal-node": ">= 0.1.3", "express": "3.x", "connect-logger": "0.x", diff --git a/sample/windows-graph-sample.js b/sample/windows-graph-sample.js new file mode 100644 index 0000000..4e476e4 --- /dev/null +++ b/sample/windows-graph-sample.js @@ -0,0 +1,34 @@ +const AuthenticationContext = require('adal-node').AuthenticationContext; +const MicrosoftGraph = require("@microsoft/microsoft-graph-client"); + +const authorityHostUrl = 'https://login.windows.net'; +const tenantName = ''; //azure active directory tenant name. ie: name.onmicrosoft.com +const authorityUrl = authorityHostUrl + '/' + tenantName; +const applicationId = ''; //application id for registered app +const clientSecret = ''; //azure active directory registered app secret +const resource = "https://graph.microsoft.com"; //URI of resource where token is valid + +const context = new AuthenticationContext(authorityUrl); + +context.acquireTokenWithClientCredentials( + resource, + applicationId, + clientSecret, + function(err, tokenResponse) { + if (err) { + console.log('well that didn\'t work: ' + err.stack); + } else { + let client = MicrosoftGraph.Client.init({ + defaultVersion: 'v1.0', + authProvider: (done) => { + done(null, tokenResponse.accessToken); + }, + }); + + client + .api('/users') + .get((err, result) => { + console.log(result, err); + }); + } +}); \ No newline at end of file From 693b9cf4a01b8b54c0d848a720b759d2a9817aee Mon Sep 17 00:00:00 2001 From: Wesley Yao Date: Fri, 25 Aug 2017 19:41:12 -0700 Subject: [PATCH 5/7] update documentation --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7fb75e4..980c694 100644 --- a/README.md +++ b/README.md @@ -106,15 +106,15 @@ See the [client credentials sample](https://github.com/MSOpenTech/azure-activedi var adal = require('adal-node').AuthenticationContext; var authorityHostUrl = 'https://login.windows.net'; -var tenant = 'myTenant'; +var tenant = 'myTenant.onmicrosoft.com'; // AAD Tenant name. var authorityUrl = authorityHostUrl + '/' + tenant; -var clientId = 'yourClientIdHere'; -var clientSecret = 'yourAADIssuedClientSecretHere' -var resource = '00000002-0000-0000-c000-000000000000'; +var applicationId = 'yourApplicationIdHere'; // Application Id of app registered under AAD. +var clientSecret = 'yourAADIssuedClientSecretHere'; // Secret generated for app. Read this environment variable. +var resource = '00000002-0000-0000-c000-000000000000'; // URI that identifies the resource for which the token is valid. var context = new AuthenticationContext(authorityUrl); -context.acquireTokenWithClientCredentials(resource, clientId, clientSecret, function(err, tokenResponse) { +context.acquireTokenWithClientCredentials(resource, applicationId, clientSecret, function(err, tokenResponse) { if (err) { console.log('well that didn\'t work: ' + err.stack); } else { From afbed2973eade41c6b5126ba73aa930e1a1c2d4c Mon Sep 17 00:00:00 2001 From: Sijun Liu Date: Wed, 11 Oct 2017 15:58:23 -0700 Subject: [PATCH 6/7] Issue #172 Add login.microsoftonline.us --- lib/constants.js | 2 +- test/authority.js | 6 ++++++ test/util/util.js | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/constants.js b/lib/constants.js index 003f837..ac8d703 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -140,7 +140,7 @@ var Constants = { AADConstants : { WORLD_WIDE_AUTHORITY : 'login.windows.net', - WELL_KNOWN_AUTHORITY_HOSTS : ['login.windows.net', 'login.microsoftonline.com', 'login.chinacloudapi.cn', 'login-us.microsoftonline.com', 'login.microsoftonline.de'], + WELL_KNOWN_AUTHORITY_HOSTS : ['login.windows.net', 'login.microsoftonline.com', 'login.chinacloudapi.cn', 'login-us.microsoftonline.com', 'login.microsoftonline.de', 'login.microsoftonline.us'], INSTANCE_DISCOVERY_ENDPOINT_TEMPLATE : 'https://{authorize_host}/common/discovery/instance?authorization_endpoint={authorize_endpoint}&api-version=1.0', AUTHORIZE_ENDPOINT_PATH : '/oauth2/authorize', TOKEN_ENDPOINT_PATH : '/oauth2/token', diff --git a/test/authority.js b/test/authority.js index 8ff81d6..27d8deb 100644 --- a/test/authority.js +++ b/test/authority.js @@ -130,7 +130,13 @@ suite('Authority', function() { return; } performStaticInstanceDiscovery('login-us.microsoftonline.com', function(err4) { + if(err4) { done(err4); + return; + } + performStaticInstanceDiscovery('login.microsoftonline.us', function(err5) { + done(err5); + }) }); }); }); diff --git a/test/util/util.js b/test/util/util.js index 0dd08f3..accebdc 100644 --- a/test/util/util.js +++ b/test/util/util.js @@ -100,7 +100,8 @@ parameters.password = ''; parameters.authorityHosts = { global : 'login.windows.net', china : 'login.chinacloudapi.cn', - gov : 'login-us.microsoftonline.com' + gov : 'login-us.microsoftonline.com', + us : 'login.microsoftonline.us' }; parameters.language = 'en'; parameters.deviceCode = 'ABCDE:device_code'; From 2ef72bc9e987ddd931a3853be3a5f60883027d9b Mon Sep 17 00:00:00 2001 From: Sijun Liu Date: Thu, 26 Oct 2017 16:10:59 -0700 Subject: [PATCH 7/7] prepare for release 0.1.23 --- README.md | 2 +- changelog.txt | 9 +++++++++ package.json | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 980c694..dcd2cf3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The ADAL for node.js library makes it easy for node.js applications to authenticate to AAD in order to access AAD protected web resources. It supports 3 authentication modes shown in the quickstart code below. ## Versions -Current version - 0.1.22 +Current version - 0.1.23 Minimum recommended version - 0.1.22 You can find the changes for each version in the [change log](https://github.com/AzureAD/azure-activedirectory-library-for-nodejs/blob/master/changelog.txt). diff --git a/changelog.txt b/changelog.txt index 6f37e97..8669d26 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,12 @@ +Version 0.1.23 +-------------- +Release Date: 26 Oct 2017 + * Fix Issue #95 - Change npm licenses to license and use spdx syntax + * Fix Issue #122 - Broken link on README file + * Fix Issue #155 - remove need for dynamic access to package.json to obtain lib version (util.js) + * Fix Issue #172 - Add login.microsoftonline.us endpoint + * Added Windows Graph Sample + Version 0.1.22 -------------- Release Date: 1 Aug 2016 diff --git a/package.json b/package.json index f960f1b..77a670a 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "type": "git", "url": "https://github.com/AzureAD/azure-activedirectory-library-for-nodejs.git" }, - "version": "0.1.22", + "version": "0.1.23", "description": "Windows Azure Active Directory Client Library for node", "keywords": [ "node", "azure", "AAD", "adal", "adfs", "oauth" ], "main": "./lib/adal.js",