StackExchange / StackExchange/StackExchange.Redis

Connecting to Google-hosted Redis with StackExchange not working with AuthString

Open
#1,895 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.2k
Forks
1.6k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Hello!

We are using StackExchange.Redis version 2.2.79 in a .NET Core 5.0 project, to connect to a Google Cloud Platform Redis instance (a.k.a Memorystore).

We are not using SSL for the connections, we just use what Google calls AuthString which is practically the password. We face issues when we are trying to connect to our instance using the library, while with redis-cli -a <password> the connection succeeds and we are able to see the contents.

The exception that we get in the code is:

StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). There was an authentication failure; check that passwords (or client certificates) are configured correctly.
   at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1194
   at StackExchange.Redis.ConnectionMultiplexer.Connect(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1061
   at StackExchange.Redis.ConnectionMultiplexer.Connect(String configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1036

For the connection through the library, we are using the following settings:

  ConfigurationOptions options = ConfigurationOptions.Parse("127.0.0.1:6379");
  options.Password = "auth-string-provided-from-gcp";
  options.AbortOnConnectFail = false;
  options.Ssl = false;
  _redisConnection = ConnectionMultiplexer.Connect(options);

P.S: If we disable authentication in GCP for our Redis instance, the connection through the library succeeds.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the failure with StackExchange.Redis 2.2.79 using ConfigurationOptions.Parse, Password, Ssl=false, and ConnectionMultiplexer.Connect, then compare it with the successful redis-cli -a connection. Trace the authentication path from ConnectionMultiplexer.ConnectImpl and determine what is needed for Google Memorystore AuthString authentication; done means the configured connection authenticates successfully while authentication remains enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, google-cloud, redis
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.