Skip to content

redis: add credentials provider option and built-in Entra ID auth - #1626

Open
cosmin-staicu wants to merge 1 commit into
livekit:mainfrom
UiPath:feat/redis-entra-credentials-provider
Open

redis: add credentials provider option and built-in Entra ID auth#1626
cosmin-staicu wants to merge 1 commit into
livekit:mainfrom
UiPath:feat/redis-entra-credentials-provider

Conversation

@cosmin-staicu

Copy link
Copy Markdown

Adds support for runtime-rotated Redis credentials to GetRedisClient, with two entry points: a vendor-neutral WithStreamingCredentialsProvider option and a config-driven azure_entra flag for Microsoft Entra ID. Backwards compatible — existing callers and YAML are unaffected.

GetRedisClient currently only accepts a static Username/Password. That doesn't work with managed Redis offerings that authenticate via short-lived identity tokens — Azure Managed Redis and Redis Enterprise Cloud issue Microsoft Entra ID tokens that expire (~1h) and must be refreshed and re-AUTH'd on the live connection before they lapse.

With only static credentials, a long-running deployment gets disconnected when the token expires. It's worst for the coordination bus that LiveKit relies on: managed Redis evicts pub/sub connections when their token expires, and under RESP2 a pub/sub socket can't process an out-of-band AUTH, so it must reconnect with a fresh token. Every component that builds its client through protocol — server, sip, egress, ingress — is affected.

go-redis already supports this through StreamingCredentialsProvider (≥ v9.6; this module is on v9.20.0), and Redis publishes an official extension, go-redis-entraid, that implements

@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a0a06fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
github.com/livekit/protocol Patch
@livekit/protocol Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant

CLAassistant commented Jun 15, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@cosmin-staicu
cosmin-staicu force-pushed the feat/redis-entra-credentials-provider branch from 63e17d0 to 3135f36 Compare August 4, 2026 14:27
@cosmin-staicu
cosmin-staicu force-pushed the feat/redis-entra-credentials-provider branch from 3135f36 to e227b1a Compare August 19, 2026 13:19
GetRedisClient only accepted a static Username/Password, which does not work
with managed Redis offerings that authenticate with short-lived identity
tokens. Azure Managed Redis and Redis Enterprise Cloud issue Microsoft Entra ID
tokens that expire after roughly an hour and have to be refreshed and re-AUTH'd
on the live connection before they lapse. Managed Redis evicts a pub/sub
connection when its token expires and, under RESP2, a pub/sub socket cannot
process an out-of-band AUTH, so it has to reconnect with a fresh token — which
hits the coordination bus every component built on this module relies on.

go-redis has supported this since v9.6 through StreamingCredentialsProvider.
Expose it two ways:

- WithStreamingCredentialsProvider, a vendor-neutral option for callers that
  bring their own provider.
- RedisConfig.azure_entra, a config-driven flag that builds a provider from
  github.com/redis/go-redis-entraid off the ambient Azure identity, so a
  deployment turns this on in YAML without its own call site.

Both are additive: GetRedisClient keeps its existing signature for callers that
pass no options, and existing YAML is unaffected.

Signed-off-by: Cosmin Staicu <cosmin.staicu@uipath.com>
@cosmin-staicu

Copy link
Copy Markdown
Author

Rebased onto current main (was conflicting) and split: this PR is now the redis commit alone, with a changeset added.

The log-config-watch work that had crept onto this branch has moved to #1791, which is stacked on this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants