14

How do I specify a username and password for the Redis hostname when instantiating a PooledRedisClientManager?

var _redis = PooledRedisClientManager("my.redishost.com:1234");

I specifically need to deploy a .NET-based ServiceStack.Redis application to AppHarbor and I'm using Redis To Go for Redis hosting.

Dan
  • 6,008
  • 7
  • 40
  • 41
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287

1 Answers1

23

https://github.com/ServiceStack/ServiceStack.Redis/wiki/Authentication

To authenticate with Redis using a password, simply pass in to the connection string using password@host syntax:

container.Register(c => new PooledRedisClientManager("password@host:6379"));
DanB
  • 1,060
  • 7
  • 13
  • 3
    Redis auth has no concept of usernames + passwords, just passwords. RedisToGo has usernames + passwords for accessing your account, but you only need a password to authenticate with your Redis instance. – DanB Feb 27 '12 at 09:03
  • Yes! I'm using Harbour.RedisSessionStateStore and ran into the same issue of trying to pass the requireauth password in in the sessionState/providers section – sonjz Apr 03 '14 at 21:32
  • As of Redis 6, there's support for username, password. Docs here: https://redis.io/topics/acl – MyGGaN Jun 18 '20 at 07:39