Example #1
0
        public static IApplicationBuilder UseIdentityServerConfigs(this IApplicationBuilder app)
        {
            using var serviceScope = app.ApplicationServices.GetService <IServiceScopeFactory>().CreateScope();
            var context = serviceScope.ServiceProvider.GetRequiredService <ConfigurationDbContext>();

            IdentityServerConfig.SaveIdentityResources(context);
            IdentityServerConfig.SaveApis(context);
            IdentityServerConfig.SaveClients(context);
            return(app);
        }