Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Data Redis: Setting a Password

I have a need to provide a secure connection to Redis from my microservices.

So if I want to add the ability to support authentication so that a client can send an AUTH command with a password. See http://redis.io/topics/security

How can I do this with the Spring Data Redis implementation?

like image 253
EvilJinious1 Avatar asked Feb 06 '23 22:02

EvilJinious1


1 Answers

Just set the password on LettuceConnectionFactory or JedisConnectionFactory, depending on which driver you're using. If you use Spring Boot, set spring.redis.password=… in your application configuration (see Common application properties.

like image 135
mp911de Avatar answered Mar 07 '23 00:03

mp911de