Couldn't find any way how to integrate spring-data-redis with Microsoft Entra ID authentication. Seems RedisTemplate can work only with RedisConnectionFactory which doesn't support connection through DefaultAzureCredentialBuilder. Is there any solution for this?
1 Answer
There seems to be no Microsoft EntraID support built in to spring-data-redis.
Good news is that both Lettuce and Jedis has their beta releases with EntraID support;
It's important to note that support for DefaultAzureCredential is not yet available in beta but work in progress for both clients.
If you don't want to wait for DefaultAzureCredential support in GA release of Jedis/Lettuce and willing to get your hands on it, here my suggestions;
With Lettuce, you can provide a
RedisCredentialsProvidertoRedisURIand configure it to auto re-authenticate. Check the user-guide for more details.With Jedis, it's possible to introduce
IdentityProviderby configuring it inJedisClientConfig, check this page. Sincespring-data-redisdoes not exposeJedisClientConfigto outside, it's a longer path to make it work withinspring-data-redis; you need to provide the implementation for RedisConnectionFactory.