To store RelyingParty
entities, an implementation of IRelyingPartyStore
must be registered.
In-Memory
A default, in-memory implementation be registered like so:
services.AddIdentityServer()
// existing registrations
.AddInMemoryRelyingParties(new List<RelyingParty>());
Entity Framework
An entity framework implementation can be found in the Rsk.WsFederation.EntityFramework nuget package. This store can be registered using the following:
services.AddDbContext<WsFederationConfigurationDbContext>(options => { /* DbContext setting */})
services.AddScoped<IWsFederationConfigurationDbContext, WsFederationConfigurationDbContext>();
services.AddIdentityServer()
// existing registrations
.AddRelyingPartyStore<RelyingPartyStore>();
Creating a Custom Implementation
A custom store for relying parties can be created by implementing IRelyingPartyStore
and then registering that implementation with AddRelyingPartyStore<>()
.
public interface IRelyingPartyStore
{
Task<RelyingParty> FindRelyingPartyByRealm(string realm);
}