Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to add password to RedisClientPool? #282

Open
AthanatiusC opened this issue Oct 21, 2021 · 5 comments
Open

How to add password to RedisClientPool? #282

AthanatiusC opened this issue Oct 21, 2021 · 5 comments

Comments

@AthanatiusC
Copy link

Hello, i have a code which uses RedisClientPool, but it does not integrate any kind of authentication yet. But now we need to change it into using authentication. So i wonder can i add password parameter into RedisClientPool? If so, may i get some example?

Thank you!

@noahlz
Copy link

noahlz commented Nov 2, 2021

RedisClientPool has a constructor parameter called secret which serves as the password parameter.

@noahlz
Copy link

noahlz commented Nov 3, 2021

@AthanatiusC can you please provide more details? I might be seeing a similar issue where my RedisClientPool is failing with java.lang.Exception: NOAUTH Authentication required.

noahlz added a commit to noahlz/scala-redis that referenced this issue Nov 3, 2021
noahlz added a commit to noahlz/scala-redis that referenced this issue Nov 3, 2021
noahlz added a commit to noahlz/scala-redis that referenced this issue Nov 3, 2021
… container is being set up properly with a password
@noahlz
Copy link

noahlz commented Nov 3, 2021

I added unit tests in a PR that prove that RedisClientPool supports authentication properly.

There is an issue with RedisClient in the new-added BATCH mode, but that's unrelated to this.

@AthanatiusC
Copy link
Author

Hello, Thank you very much for the kind reply. I have not been looking at email for the past few days.
Thanks to your help of Secret parameter, i have been successfully use RedisClientPool with password... there was some edge case where authentication failed but it was just my workplace environment failure.

Thank you!

@AthanatiusC
Copy link
Author

If anyone were to encounter some difficulties constructing the pool. Here is some code i have been successfully use the pool with

lazy val redisClientPool = new RedisClientPool(redisServerUrl, redisPort, database = redisDatabaseName,secret=Some(redisPassword))

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants