Example #1
0
        private static IIdentityServerBuilder RegisterIdentityServerStoresWithDbContexts
        <TConfigurationDbContext, TPersistedGrantDbContext>
            (IIdentityServerBuilder builder, IConfiguration configuration, ILogger logger,
            Action <ConfigurationStoreOptions> configurationStoreOptions, Action <OperationalStoreOptions> operationalStoreOptions)
            where TPersistedGrantDbContext : DbContext, IPersistedGrantDbContext
            where TConfigurationDbContext : DbContext, IConfigurationDbContext
        {
            // Config DB from existing connection
            builder.AddConfigurationStore <TConfigurationDbContext>(configurationStoreOptions);

            // Operational DB from existing connection
            builder.AddOperationalStore <TPersistedGrantDbContext>(operationalStoreOptions);

            builder.AddCustomSigningCredential(configuration, logger);
            builder.AddCustomValidationKey(configuration, logger);

            return(builder);
        }