Support for storing data protection keys in Redis. This package was built from the source code at https://github.com/dotnet/dotnet/tree/87bc0b04e21d786669142109a5128c95618b75ed
$ dotnet add package Microsoft.AspNetCore.DataProtection.StackExchangeRedisMicrosoft.AspNetCore.DataProtection.StackExchangeRedis allows storing data protection keys in a Redis cache.
[!WARNING] Only Redis versions supporting Redis Data Persistence should be used to store keys. Azure Blob storage is persistent and can be used to store keys. For more information, see this GitHub issue.
To use Microsoft.AspNetCore.DataProtection.StackExchangeRedis, follow these steps:
dotnet add package Microsoft.AspNetCore.DataProtection.StackExchangeRedis
To configure data protection key storage on Redis, call one of the PersistKeysToStackExchangeRedis overloads:
var redis = ConnectionMultiplexer.Connect("<URI>");
builder.Services.AddDataProtection()
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
For additional documentation and examples, refer to the official documentation on the Redis key storage provider.
Microsoft.AspNetCore.DataProtection.StackExchangeRedis is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.