AzureAD/azure-activedirectory-library-for-nodejs

Token Cache not updates correctly

jdneo opened this issue · 2 comments

jdneo commented

I have to create a new issue here because the original one #197 is closed by mistake and no further response after that.


The code here:

if (_.isEqual(element, addElement)) {
is using isEqual to check if two token entries are equal or not. But sometimes, addElement is just an update of element, (All the fields are equal except the expiresOn)

For example:
image

image

Then, after add method, the token cache will have two tokens which are duplicated.

After that, when we trigger find for the token cache, it will cause More than one token matches the criteria. The result is ambiguous error.

Here:

callback(self._log.createError('More than one token matches the criteria. The result is ambiguous.'));

All current authentication work from Microsoft is delivered through the msal js library here There is plans to add a similar node.js wrapper to msal js, as can be seen on our roadmap here. adal js, and the adal-node wrapper, are still supported only for security fixes. We recommend moving to msal js for any advanced feature requests and bugfixes.

All current authentication work from Microsoft is delivered through the msal js library here There is plans to add a similar node.js wrapper to msal js, as can be seen on our roadmap here. adal js, and the adal-node wrapper, are still supported only for security fixes. We recommend moving to msal js for any advanced feature requests and bugfixes.

Hi
Do you know how to solve the flowing issue? Or will MSAL provide the version of node.js for devicelogin?

AzureAD/azure-activedirectory-library-for-nodejs#215
This could be migrated to MSAL otherwise but the Node.js version doesn't support OAuth Device Flow.