How to use existing IdentityServer4 instanceΒΆ

  • You can use one or more DbContexts for the administration.
  • The configuration of DbContexts is in the Startup.cs:
  1. Single DbContext:
::
services.AddAdminServices<AdminDbContext>();

AddAdminServices expects one generic param:

  • TAdminDbContext - It requires to implement interfaces IAdminConfigurationDbContext, IAdminPersistedGrantDbContext, IAdminLogDbContext
  1. Multiple DbContexts:
  • It is possible to overload this method:
::
services.AddAdminServices<TConfigurationDbContext, TPersistedGrantDbContext, TLogDbContext>();

AddAdminServices expects following generic params:

  • TConfigurationDbContext - DbContext for the configuration data - It requires to implement interface IAdminConfigurationDbContext
  • TPersistedGrantDbContext - DbContext for the operational data - It requires to implement interface IAdminPersistedGrantDbContext
  • TLogDbContext - for the logs - DbContext for the operational data - It requires to implement interface IAdminLogDbContext