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

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanishk Panwar committed Aug 1, 2016
2 parents 9e21b32 + 4bb473d commit 2b8808e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Version 0.1.22
--------------
Release Date: 1 Aug 2016
* Fix Issue #132 - Trim developer provided authority to construct endpoints

Version 0.1.21
--------------
Release Date: 23 Jun 2016
Expand Down
4 changes: 2 additions & 2 deletions lib/authority.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ Authority.prototype._getOAuthEndpoints = function(tenantDiscoveryEndpoint, callb
} else {
// fallback to the well known token endpoint path.
if (!this._tokenEndpoint){
this._tokenEndpoint = url.format(this._url) + AADConstants.TOKEN_ENDPOINT_PATH;
this._tokenEndpoint = url.format('https://' + this._url.host + '/' + this._tenant) + AADConstants.TOKEN_ENDPOINT_PATH;
}

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

callback();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/AzureAD/azure-activedirectory-library-for-nodejs.git"
},
"version": "0.1.21",
"version": "0.1.22",
"description": "Windows Azure Active Directory Client Library for node",
"keywords": [ "node", "azure", "AAD", "adal", "adfs", "oauth" ],
"main": "./lib/adal.js",
Expand Down
3 changes: 3 additions & 0 deletions test/authority.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ suite('Authority', function() {
if (err) {
assert(!err, 'Received unexpected error: ' + err.stack);
}

assert(authority.tokenEndpoint === (nonHardCodedAuthority + cp.tokenPath), "oauth2 token endpoint should be after tenant in the url");
assert(authority.deviceCodeEndpoint === (nonHardCodedAuthority + cp.deviceCodePath), "oauth2 device endpoint should be after tenant in the url");
instanceDiscoveryRequest.done();
done();
});
Expand Down

0 comments on commit 2b8808e

Please sign in to comment.