Skip to content

Conversation

@vchomakov
Copy link
Contributor

Add EntraID Authentication Support for Azure Managed Redis

Overview

Implements comprehensive EntraID (Azure Active Directory) authentication for Azure Managed Redis, enabling OAuth-based authentication with automatic token management and graceful fallback to standard Redis authentication.

Features Added

Authentication Providers

  • Service Principal - Application-based authentication (client ID, secret, tenant)
  • Managed Identity - Both system-assigned and user-assigned identities
  • Default Azure Credential - Automatic credential discovery for Azure environments

Key Capabilities

  • Automatic token renewal - Background token refresh with redis-entraid
  • Graceful fallback - Falls back to standard Redis auth when EntraID not configured
  • Backward compatibility - Existing Redis configurations continue to work unchanged
  • Enterprise ready - Designed for Azure Managed Redis tier

Technical Implementation

Core Changes

  • Integrated redis-entraid package for OAuth token management
  • Added credential provider factory with multiple auth flows

Configuration

# Authentication flow selection (required)
REDIS_ENTRAID_AUTH_FLOW=service_principal

# Service Principal Authentication
REDIS_ENTRAID_CLIENT_ID=your-client-id
REDIS_ENTRAID_CLIENT_SECRET=your-client-secret
REDIS_ENTRAID_TENANT_ID=your-tenant-id

# Managed Identity Authentication  
REDIS_ENTRAID_AUTH_FLOW=managed_identity
REDIS_ENTRAID_IDENTITY_TYPE=system_assigned
# or
REDIS_ENTRAID_IDENTITY_TYPE=user_assigned
REDIS_ENTRAID_USER_ASSIGNED_CLIENT_ID=your-identity-client-id

# Default Azure Credential
REDIS_ENTRAID_AUTH_FLOW=default_credential
REDIS_ENTRAID_SCOPES=https://redis.azure.com/.default

Copy link
Member

@bobymicroby bobymicroby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vchomakov vchomakov merged commit 46761b7 into main Oct 24, 2025
23 checks passed
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.

3 participants