Skip to content

Support Azure Entra ID (Azure AD) token-based authentication with auto-refresh #2022

@glm2bg

Description

@glm2bg

Hi,

I’m working with Azure Cache for Redis and Microsoft Entra ID (formerly Azure AD) authentication. Azure supports connecting to Redis using Entra access tokens instead of a static password. These tokens expire after ~1 hour and require automatic refresh.

Currently, ioredis only supports static connection strings/passwords. This makes it difficult to use with Azure Entra ID, since we’d have to manually recreate the client whenever a token expires.

Feature request:

Add support for token-based authentication for Redis when using Azure Entra ID.

Ideally provide a way to plug in a token provider (e.g., from @azure/identity or MSAL) so ioredis can refresh the token automatically before expiration.

Use case:

Applications connecting to Azure Cache for Redis using enterprise authentication (Entra ID) instead of static keys.

Frameworks like @fastify/redis rely on ioredis internally, so this feature would enable ecosystem-wide adoption.

References:

Azure docs: Authenticate with Microsoft Entra ID to access Azure Cache for Redis

Would this be considered for future support?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions