Skip to content

Connection Reauthentication always fails #51

Description

@a99cl208

Hello,

Package v3.0.0 introducted the GetUserName function here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheOptions.cs#L81
Which is used to assign the User property on the ConfigurationOptions here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheForRedis.cs#L116

However, the function is not used to override the User property of the AzureOptionsProvider base class of AzureCacheOptionsProviderWithToken
which is assigned to ConfigurationOptions.Default here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheForRedis.cs#L115

As a consequence, when the reauthentication is done here: https://github.com/Azure/Microsoft.Azure.StackExchangeRedis/blob/main/src/AzureCacheOptionsProviderWithToken.cs#L241
The User property passed is null because not overridden (as it was in v2.0.0 of the package).

This makes the execution failed systematically, with error "ERR protocol error: invalid bulk length".

To solve this bug, you have to override the User property inside the AzureCacheOptionsProviderWithToken class, and assign its value from the GetUserName function of the AzureCacheOptions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions