d1ag0n
d1ag0n
CC#
Created by d1ag0n on 1/21/2025 in #help
IDataProtectionBuilder.AddKeyManagementOptions
I have multiple API servers and I want them to be capable of sharing cookies so I have this code. How can I do this better?
c#
WebApplication app = null;
...
builder.Services.AddDataProtection()
.SetApplicationName("MyApplication")
.AddKeyManagementOptions(options => {
var db = ActivatorUtilities.CreateInstance<MyDatabaseService>(app.Services);
options.XmlRepository = new MyXMLRepo(db);
});
...
app = builder.Build();
...
c#
WebApplication app = null;
...
builder.Services.AddDataProtection()
.SetApplicationName("MyApplication")
.AddKeyManagementOptions(options => {
var db = ActivatorUtilities.CreateInstance<MyDatabaseService>(app.Services);
options.XmlRepository = new MyXMLRepo(db);
});
...
app = builder.Build();
...
9 replies