Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 2b8808e

Browse files
author
Kanishk Panwar
committed
Merge branch 'dev'
2 parents 9e21b32 + 4bb473d commit 2b8808e

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

changelog.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Version 0.1.22
2+
--------------
3+
Release Date: 1 Aug 2016
4+
* Fix Issue #132 - Trim developer provided authority to construct endpoints
5+
16
Version 0.1.21
27
--------------
38
Release Date: 23 Jun 2016

lib/authority.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,11 @@ Authority.prototype._getOAuthEndpoints = function(tenantDiscoveryEndpoint, callb
227227
} else {
228228
// fallback to the well known token endpoint path.
229229
if (!this._tokenEndpoint){
230-
this._tokenEndpoint = url.format(this._url) + AADConstants.TOKEN_ENDPOINT_PATH;
230+
this._tokenEndpoint = url.format('https://' + this._url.host + '/' + this._tenant) + AADConstants.TOKEN_ENDPOINT_PATH;
231231
}
232232

233233
if (!this._deviceCodeEndpoint){
234-
this._deviceCodeEndpoint = url.format(this._url) + AADConstants.DEVICE_ENDPOINT_PATH;
234+
this._deviceCodeEndpoint = url.format('https://' + this._url.host + '/' + this._tenant) + AADConstants.DEVICE_ENDPOINT_PATH;
235235
}
236236

237237
callback();

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"type": "git",
1616
"url": "https://github.com/AzureAD/azure-activedirectory-library-for-nodejs.git"
1717
},
18-
"version": "0.1.21",
18+
"version": "0.1.22",
1919
"description": "Windows Azure Active Directory Client Library for node",
2020
"keywords": [ "node", "azure", "AAD", "adal", "adfs", "oauth" ],
2121
"main": "./lib/adal.js",

test/authority.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ suite('Authority', function() {
252252
if (err) {
253253
assert(!err, 'Received unexpected error: ' + err.stack);
254254
}
255+
256+
assert(authority.tokenEndpoint === (nonHardCodedAuthority + cp.tokenPath), "oauth2 token endpoint should be after tenant in the url");
257+
assert(authority.deviceCodeEndpoint === (nonHardCodedAuthority + cp.deviceCodePath), "oauth2 device endpoint should be after tenant in the url");
255258
instanceDiscoveryRequest.done();
256259
done();
257260
});

0 commit comments

Comments
 (0)