Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.03k stars 1.19k forks source link

Enhance ioredis samples for token refresh use cases #29644

Open samsaha-ms opened 4 months ago

samsaha-ms commented 4 months ago

Hello, We request to enhance the ioredis samples here to better support the token refresh scenario along with clustered caches. Following are two asks we have:

  1. Current sample here https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureCacheForRedis/ioredis.md#migration-guidance-2, does not update the redis client object password field with new token after token refresh. This can be done by adding redis.options.password = accessTokenCache.token to update password with new token in client object as well after this line inside updateToken() function.
  2. Add a separate sample for clustered caches for token refresh. For clustered caches, we need to loop over each client node object and update password with new token and send auth command. Example can be found below. image
github-actions[bot] commented 4 months ago

@KarishmaGhiya @maorleger

github-actions[bot] commented 4 months ago

Thank you for your feedback. Tagging and routing to the team member best able to assist.