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

Version 2.0.1

Choose a tag to compare

@polita polita released this 24 Aug 19:51
· 198 commits to master since this release

Major changes from 2.0.0

Security Fix

  • Version 2.0.1 fixes a known security vulnerability affecting versions <1.4.6 and 2.0.0. All users should upgrade to 2.0.1 or greater immediately. For more details, see the Security-Notice for more details.

BearerStrategy

  • Metadata is loaded only once in 2.0.0, which happens at the creation time of the strategy. In 2.0.1 we load metadata for each request that requires authentication. We keep the metadata in memory cache for 30 minutes. Whenever we need to load the metadata, we check the memory cache first. If we don't find it we then load the metadata from AAD and save it in memory cache. This way BearerStrategy can automatically handle the key rolling of Azure Active Directory.
  • The default value of validateIssuer is true.

OIDCStrategy

  • For OIDCStrategy, we now support 'code id_token' as the response_type, in addition to 'code', 'id_token code' and 'id_token'.
  • The default value of validateIssuer is true.

Miscellaneous

  • For non-server-related errors, in 2.0.1 we call Strategy.fail function instead of throwing an error, so the user can do the failure redirection.
  • Added chai-passport-strategy testing tool and more unit tests.
  • Fixed some bugs in examples.
  • Added telemetry parameters in both OIDCStrategy and BearerStrategy when sending requests to Azure Active Directory.

Upgrade Notes

  1. This patch updates the library that your application runs, but does not change the current state of your users, including any sessions they had open. This applies to malicious users who could have exploited this vulnerability to gain access to your system. If your application has users with existing sessions open, after applying the patch, ensure all these sessions are terminated and users are required to sign in again.
  2. In previous versions of the Passport-Azure-AD for NodeJS library, the issuer wasn't validated, even if you had set validateIssuer to true in your configuration. This is fixed in versions 1.4.6 and 2.0.1. However, this may mean you get 401s if you are using the common endpoint in the identityMetadata config setting and have validateIssuer to true. If you are using the common endpoint (which looks like "https://login.microsoftonline.com/common/.well-known/openid-configuration"), issuers cannot be validated. You can fix this in two ways:

Bug fixes in 2.0.1

  • #71 Cryptic error message when the client ID is null/undefined
  • #90 Cannot read property 'keys' of undefined
  • #117 TypeError: Invalid hex string in aadutils.js
  • #112 done is not a function. bearerstrategy.js:149
  • #121 Error with regex into pem.js