Skip to content

Commit aeef2eb

Browse files
MackinnonBuckcaptainsafia
authored andcommitted
Provide Microsoft.AspNetCore.DataProtection.StackExchangeRedis package README (#57825)
1 parent f337128 commit aeef2eb

File tree

1 file changed

+34
-0
lines changed
  • src/DataProtection/StackExchangeRedis/src

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## About
2+
3+
`Microsoft.AspNetCore.DataProtection.StackExchangeRedis` allows storing data protection keys in a Redis cache.
4+
5+
> [!WARNING]
6+
> Only Redis versions supporting [Redis Data Persistence](https://learn.microsoft.com/azure/azure-cache-for-redis/cache-how-to-premium-persistence) should be used to store keys. [Azure Blob storage](https://learn.microsoft.com/azure/storage/blobs/storage-blobs-introduction) is persistent and can be used to store keys. For more information, see [this GitHub issue](https://github.com/dotnet/AspNetCore/issues/13476).
7+
8+
## How to Use
9+
10+
To use `Microsoft.AspNetCore.DataProtection.StackExchangeRedis`, follow these steps:
11+
12+
### Installation
13+
14+
```shell
15+
dotnet add package Microsoft.AspNetCore.DataProtection.StackExchangeRedis
16+
```
17+
18+
### Configuration
19+
20+
To configure data protection key storage on Redis, call one of the `PersistKeysToStackExchangeRedis` overloads:
21+
22+
```csharp
23+
var redis = ConnectionMultiplexer.Connect("<URI>");
24+
builder.Services.AddDataProtection()
25+
.PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
26+
```
27+
28+
## Additional Documentation
29+
30+
For additional documentation and examples, refer to the [official documentation](https://learn.microsoft.com/aspnet/core/security/data-protection/implementation/key-storage-providers#redis) on the Redis key storage provider.
31+
32+
## Feedback &amp; Contributing
33+
34+
`Microsoft.AspNetCore.DataProtection.StackExchangeRedis` is released as open-source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/dotnet/aspnetcore).

0 commit comments

Comments
 (0)