AzureAD / passport-azure-ad

The code for Passport Azure AD has been moved to the MSAL.js repo. Please open any issues or PRs at the link below.
https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/maintenance/passport-azure-ad
Other
422 stars 176 forks source link

Met with userAgent undefined issue #529

Closed zhenglaizhang closed 3 years ago

zhenglaizhang commented 3 years ago

The aadutils.js has logic to check if userAgent includes some specific agent, but for some kind requests, the userAgent is empty, and exception is thrown as below:

TypeError: Cannot read property 'includes' of undefined at exports.sameSiteNotAllowed (/app/node_modules/passport-azure-ad/lib/aadutils.js:285:21) at CookieContentHandler.add (/app/node_modules/passport-azure-ad/lib/cookieContentHandler.js:142:31) at Strategy.flowInitializationHandler [as _flowInitializationHandler] (/app/node_modules/passport-azure-ad/lib/oidcstrategy.js:1408:32) at /app/node_modules/passport-azure-ad/lib/oidcstrategy.js:645:23 at fn (/app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:746:34) at /app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:1213:16 at /app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:166:37 at /app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:706:43 at /app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:167:37 at /app/node_modules/passport-azure-ad/node_modules/async/lib/async.js:1209:30

sameerag commented 3 years ago

@zhenglaizhang Is this still an issue? This library is currently in maintenance phase and we are taking only security bugs. If this issue persists, can you please leave the feedback on the repo below?

We are currently in the design phase of a new version of this library, which can be tracked here. The timeline for the new library will be uploaded to our msal js repo.