RedisSessionProvider icon indicating copy to clipboard operation
RedisSessionProvider copied to clipboard

How to provide Password

Open chandudinesh opened this issue 8 years ago • 1 comments

Hi,

My current redis instance is password protected. In the obsolete 'GetRedisServerAddress' Method, we have privilege to add password for redis server.

Can you please provide code snippet how to add 'password' information using ConfigurationOptions.

This is what i've used. It didn't work.

  Application["redisConfigurationOptions"] = new ConfigurationOptions
        {
            AllowAdmin = true,
            Password = "Omg@123"                
        };

        Application["redisConfigurationOptions"] = ConfigurationOptions.Parse("localhost:6379");          

        RedisConnectionConfig.GetSERedisServerConfig = (HttpContextBase context) =>
        {
            return new KeyValuePair<string, ConfigurationOptions>(
                "redisConnection",   
                (ConfigurationOptions)Application["redisConfigurationOptions"]);
        };

chandudinesh avatar Jul 05 '16 13:07 chandudinesh

You are overwriting the value of Application ["redisConfigurationOptions"], so it does not work.

Try Application["redisConfigurationOptions"] = ConfigurationOptions.Parse("localhost:6379,password=[YOUR_PASSWORD],allowAdmin=true");

guibranco avatar Nov 05 '18 18:11 guibranco