AzureAD/azure-activedirectory-library-for-nodejs

Token Cache not updates correctly

jdneo opened this issue · 4 comments

jdneo commented

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.'));

prowe commented

Could this be resolved by #188 ?

jdneo commented

Looks good. Thanks

Closing as this seems to be resolved.

jdneo commented

@navyasric

May I ask why you close this issue? The code there hasn't got any updates. The PR referenced by @prowe is still open.