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

Commit

Permalink
Merge pull request #330 from AzureAD/dev
Browse files Browse the repository at this point in the history
Release 3.0.8
  • Loading branch information
lovemaths authored Jul 13, 2017
2 parents 0908008 + 764362d commit e9087b8
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 96 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
node_modules/
test/End_to_end_test/app/node_modules/
test/End_to_end_test/node_modules/
test/End_to_end_test/debug.log
.idea/
npm-debug.log
federationmetadata.xml
*.sublime-workspace
package-lock.json
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
<a name="3.0.7"></a>
<a name="3.0.8"></a>
# 3.0.8

## OIDCStrategy

### Bug fixes

* [#328](https://github.com/AzureAD/passport-azure-ad/issues/328) OIDC session key fails to serialize for certain session middleware options

* Support advanced policy name with prefix b2c_1a_

# 3.0.7

## OIDCStrategy
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ and with [Microsoft Active Directory Federation Services](http://en.wikipedia.or
_passport-azure-ad_ has a known security vulnerability affecting versions <1.4.6 and 2.0.0. Please update to >=1.4.6 or >=2.0.1 immediately. For more details, see the [security notice](https://github.com/AzureAD/passport-azure-ad/blob/master/SECURITY-NOTICE.MD).

## 2. Versions
Current version - 3.0.7
Current version - 3.0.8
Minimum recommended version - 1.4.6
You can find the changes for each version in the [change log](https://github.com/AzureAD/passport-azure-ad/blob/master/CHANGELOG.md).

Expand Down
4 changes: 1 addition & 3 deletions lib/bearerstrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ const log = new Log('AzureAD: Bearer Strategy');
const memoryCache = cacheManager.caching({ store: 'memory', max: 3600, ttl: 1800 /* seconds */ });
const ttl = 1800; // 30 minutes cache

const B2C_PREFIX = 'b2c_1_';

/**
* Applications must supply a `verify` callback, for which the function
* signature is:
Expand Down Expand Up @@ -267,7 +265,7 @@ function Strategy(options, verifyFn) {

// for B2C,
if (options.isB2C) {
if (!options.policyName || !options.policyName.toLowerCase().startsWith(B2C_PREFIX))
if (!options.policyName || !CONSTANTS.POLICY_REGEX.test(options.policyName))
throw new Error('In BearerStrategy constructor: invalid policy for B2C');
if (options._isCommonEndpoint)
throw new Error(`In BearerStrategy constructor: common endpoint is not supported for B2C, please replace 'common' with your tenant name or tenant guid in 'identityMetadata'`);
Expand Down
2 changes: 1 addition & 1 deletion lib/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

var CONSTANTS = {};

CONSTANTS.POLICY_REGEX = /^b2c_1_[0-9a-z._-]+$/i; // policy is case insensitive
CONSTANTS.POLICY_REGEX = /^b2c_1a?_[0-9a-z._-]+$/i; // policy is case insensitive
CONSTANTS.TENANTNAME_REGEX = /^[0-9a-zA-Z]+.onmicrosoft.com$/;
CONSTANTS.TENANTID_REGEX = /^[0-9a-zA-Z-]+$/;

Expand Down
2 changes: 1 addition & 1 deletion lib/oidcstrategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function Strategy(options, verify) {
* |--- ...
* |--- 'user': full user info
*/
this._key = options.sessionKey || ('OIDC: ' + options.redirectUrl);
this._key = options.sessionKey || ('OIDC: ' + options.clientID);

if (!options.identityMetadata) {
// default value should be https://login.microsoftonline.com/common/.well-known/openid-configuration
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "passport-azure-ad",
"version": "3.0.7",
"version": "3.0.8",
"license": "MIT",
"keywords": [
"azure active directory",
Expand Down
9 changes: 9 additions & 0 deletions test/Chai-passport_test/constants_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ describe('policy checking', function() {
expect(CONSTANTS.POLICY_REGEX.test('B2C_1_My.SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1_My_SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1_My-SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('b2c_1a_signin')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1a_SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1a_My.SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1A_My_SIGNIN')).to.equal(true);
expect(CONSTANTS.POLICY_REGEX.test('B2C_1A_My-SIGNIN')).to.equal(true);
done();
});

Expand All @@ -49,6 +54,10 @@ describe('policy checking', function() {
expect(CONSTANTS.POLICY_REGEX.test('b2c_SIGNIN')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('b2c_1_')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('b2c_1_*SIGNIN')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('signin')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('b2c_a_SIGNIN')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('b2c_1A_')).to.equal(false);
expect(CONSTANTS.POLICY_REGEX.test('b2c_1A_*SIGNIN')).to.equal(false);
done();
});
});
Expand Down
97 changes: 17 additions & 80 deletions test/Chai-passport_test/jwe_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,47 +27,17 @@ describe('positive test', function() {

it('should pass with RSA-OAEP and A256GCM', function(done) {
var jwk = [{ "kty":"RSA",
"n":"oahUIoWw0K0usKNuOR6H4wkf4oBUXHTxRvgb48E-BVvxkeDNjbC4he8rUW\
cJoZmds2h7M70imEVhRU5djINXtqllXI4DFqcI1DgjT9LewND8MW2Krf3S\
psk_ZkoFnilakGygTwpZ3uesH-PFABNIUYpOiN15dsQRkgr0vEhxN92i2a\
sbOenSZeyaxziK72UwxrrKoExv6kc5twXTq4h-QChLOln0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LaV\
mqgfwX7XWRxv2322i-vDxRfqNzo_tETKzpVLzfiwQyeyPGLBIO56YJ7eObdv0je8\
1860ppamavo35UgoRdbYaBcoh9QcfylQr66oc6vFWXRcZ_ZT2LawVCWTIy3brGPi\
6UklfCpIMfIjf7iGdXKHzg.\
48V1_ALb6US04U3b.\
5eym8TW_c8SuK0ltJ3rpYIzOeDQz7TALvtu6UG9oMo4vpzs9tX_EFShS8iB7j6ji\
SdiwkIr3ajwQzaBtQD_A.\
XFBoMYUZodetZdvTiFvSkQ";
var jweString = "eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.OKOawDo13gRp2ojaHV7LFpZcgV7T6DVZKTyKOMTYUmKoTCVJRgckCL9kiMT03JGeipsEdY3mx_etLbbWSrFr05kLzcSr4qKAq7YN7e9jwQRb23nfa6c9d-StnImGyFDbSv04uVuxIp5Zms1gNxKKK2Da14B8S4rzVRltdYwam_lDp5XnZAYpQdb76FdIKLaVmqgfwX7XWRxv2322i-vDxRfqNzo_tETKzpVLzfiwQyeyPGLBIO56YJ7eObdv0je81860ppamavo35UgoRdbYaBcoh9QcfylQr66oc6vFWXRcZ_ZT2LawVCWTIy3brGPi6UklfCpIMfIjf7iGdXKHzg.48V1_ALb6US04U3b.5eym8TW_c8SuK0ltJ3rpYIzOeDQz7TALvtu6UG9oMo4vpzs9tX_EFShS8iB7j6jiSdiwkIr3ajwQzaBtQD_A.XFBoMYUZodetZdvTiFvSkQ";

var decrypted;
jwe.decrypt(jweString, jwk, log, (error, decrypted_token) => { decrypted = decrypted_token; });
Expand All @@ -78,46 +48,17 @@ describe('positive test', function() {

it('should pass with RSA1_5 and A128CBC-HS256', function(done) {
var jwk = [{"kty":"RSA",
"n":"sXchDaQebHnPiGvyDOAT4saGEUetSyo9MKLOoWFsueri23bOdgWp4Dy1Wl\
UzewbgBHod5pcM9H95GQRV3JDXboIRROSBigeC5yjU1hGzHHyXss8UDpre\
cbAYxknTcQkhslANGRUZmdTOQ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2xGdULU7sHNF6Gp2vPLgNZ__deLKxGHZ7Pc\
HALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRirb6Y5Cl_p-ko3YvkkysZIF\
NPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8OtvzlV7elprCbuPhcCdZ6XDP0_F8\
rkXds2vE4X-ncOIM8hAYHHi29NX0mcKiRaD0-D-ljQTP-cFPgwCp6X-nZZd9OHBv\
-B3oWh2TbqmScqXMR4gp_A.\
AxY8DCtDaGlsbGljb3RoZQ.\
KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY.\
9hH0vgRfYgPnAHOd8stkvw";
var jweString = "eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.UGhIOguC7IuEvf_NPVaXsGMoLOmwvc1GyqlIKOK1nN94nHPoltGRhWhw7Zx0-kFm1NJn8LE9XShH59_i8J0PH5ZZyNfGy2xGdULU7sHNF6Gp2vPLgNZ__deLKxGHZ7PcHALUzoOegEI-8E66jX2E4zyJKx-YxzZIItRzC5hlRirb6Y5Cl_p-ko3YvkkysZIFNPccxRU7qve1WYPxqbb2Yw8kZqa2rMWI5ng8OtvzlV7elprCbuPhcCdZ6XDP0_F8rkXds2vE4X-ncOIM8hAYHHi29NX0mcKiRaD0-D-ljQTP-cFPgwCp6X-nZZd9OHBv-B3oWh2TbqmScqXMR4gp_A.AxY8DCtDaGlsbGljb3RoZQ.KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY.9hH0vgRfYgPnAHOd8stkvw";

var decrypted;
jwe.decrypt(jweString, jwk, log, (error, decrypted_token) => { decrypted = decrypted_token; });
Expand All @@ -128,11 +69,7 @@ describe('positive test', function() {

it('should pass with A128KW and A128CBC-HS256', function(done) {
var jwk = [ { 'kty': 'oct', 'k': 'GawgguFyGrWKav7AX4VKUg' }];
var jweString = 'eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.\
6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ.\
AxY8DCtDaGlsbGljb3RoZQ.\
KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY.\
U0m_YmjN04DJvceFICbCVQ';
var jweString = 'eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4Q0JDLUhTMjU2In0.6KB707dM9YTIgHtLvtgWQ8mKwboJW3of9locizkDTHzBC2IlrT1oOQ.AxY8DCtDaGlsbGljb3RoZQ.KDlTtXchhZTGufMYmOYGS4HffxPSUrfmqCHXaI9wOGY.U0m_YmjN04DJvceFICbCVQ';

var decrypted;
jwe.decrypt(jweString, jwk, log, (error, decrypted_token) => { decrypted = decrypted_token; });
Expand Down
6 changes: 3 additions & 3 deletions test/End_to_end_test/oidc_b2c_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ var checkResult = (test_app_config, done) => {
driver.get('http://localhost:3000/login?p=b2c_1_signup')
.then(() => {
if (first_time) {
driver.wait(until.titleIs('User Details'), 10000);
driver.wait(until.titleIs('User details'), 10000);
}
})
.then(() => {
Expand All @@ -237,11 +237,11 @@ var checkResult = (test_app_config, done) => {
})
.then(() => {
driver.get('http://localhost:3000/login?p=b2c_1_resetpassword');
driver.wait(until.titleIs('User Details'), 10000);
driver.wait(until.titleIs('User details'), 10000);
})
.then(() => {
driver.get('http://localhost:3000/login?p=b2c_1_updateprofile');
driver.wait(until.titleIs('Update Profile'), 10000);
driver.wait(until.titleIs('Update profile'), 10000);
})
.then(() => {
server.shutdown(done);
Expand Down
2 changes: 1 addition & 1 deletion test/End_to_end_test/oidc_cookie_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var code_config = {
validateIssuer: true,
passReqToCallback: false,
scope: null,
loggingLevel: 'info',
loggingLevel: null,
useCookieInsteadOfSession: true,
nonceLifetime: null,
nonceMaxAmount: 5,
Expand Down
2 changes: 1 addition & 1 deletion test/End_to_end_test/oidc_jwe_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var code_config = {
validateIssuer: false,
passReqToCallback: false,
scope: null,
loggingLevel: 'info',
loggingLevel: null,
nonceLifetime: null,
jweKeyStore: [
{ 'kid': 'sym_key_128', 'kty': 'oct', 'k': 'GawgguFyGrWKav7AX4VKUg'},
Expand Down
2 changes: 1 addition & 1 deletion test/End_to_end_test/oidc_testing_sts_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var code_config = {
validateIssuer: true,
passReqToCallback: false,
scope: null,
loggingLevel: 'info',
loggingLevel: null,
nonceLifetime: null,
};

Expand Down
1 change: 1 addition & 0 deletions test/End_to_end_test/oidc_v1_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ var checkResultForPromptAndHint = (test_app_config, authenticate_opt, done) => {
var usernamebox = driver.findElement(By.name('login'));
usernamebox.sendKeys(test_parameters.username);
}

var passwordbox = driver.findElement(By.name('passwd'));
passwordbox.sendKeys(test_parameters.password);
driver.sleep(LOGIN_WAITING_TIME);
Expand Down
2 changes: 1 addition & 1 deletion test/End_to_end_test/oidc_v2_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ var apply_test_parameters = (done) => {
issuer: ['https://login.microsoftonline.com/' + test_parameters.tenantID + '/v2.0'],
passReqToCallback: false,
scope: ['user.read'],
loggingLevel: 'info',
loggingLevel: null,
nonceLifetime: null,
};

Expand Down

0 comments on commit e9087b8

Please sign in to comment.