From 738f6f2ce8a4b21274e3982ca2fdd102d821e1da Mon Sep 17 00:00:00 2001 From: Marko Matic Date: Wed, 18 Dec 2019 09:29:53 +0100 Subject: [PATCH] exposed IIdentityServerBuilder back to Startup.cs and ConfigureServices --- .../Helpers/StartupHelpers.cs | 8 ++++---- src/Skoruba.IdentityServer4.STS.Identity/Startup.cs | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs b/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs index 31d9528fd..f50a5c791 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs +++ b/src/Skoruba.IdentityServer4.STS.Identity/Helpers/StartupHelpers.cs @@ -263,8 +263,6 @@ public static void AddAuthenticationServices(services, configuration); } /// @@ -311,8 +309,8 @@ private static RegisterConfiguration GetRegistrationConfiguration(IConfiguration /// /// /// - private static void AddIdentityServer( - IServiceCollection services, + public static IIdentityServerBuilder AddIdentityServer( + this IServiceCollection services, IConfiguration configuration) where TPersistedGrantDbContext : DbContext, IAdminPersistedGrantDbContext where TConfigurationDbContext : DbContext, IAdminConfigurationDbContext @@ -331,6 +329,8 @@ private static void AddIdentityServer diff --git a/src/Skoruba.IdentityServer4.STS.Identity/Startup.cs b/src/Skoruba.IdentityServer4.STS.Identity/Startup.cs index 60dd0ef93..92c3a6bd3 100644 --- a/src/Skoruba.IdentityServer4.STS.Identity/Startup.cs +++ b/src/Skoruba.IdentityServer4.STS.Identity/Startup.cs @@ -35,8 +35,11 @@ public void ConfigureServices(IServiceCollection services) // Add email senders which is currently setup for SendGrid and SMTP services.AddEmailSenders(Configuration); - // Add services for authentication, including Identity model, IdentityServer4 and external providers - services.AddAuthenticationServices(Configuration); + // Add services for authentication, including Identity model and external providers + services.AddAuthenticationServices(Configuration); + + // Add services for IdentityServer4 + services.AddIdentityServer(Configuration); // Add all dependencies for Asp.Net Core Identity in MVC - these dependencies are injected into generic Controllers // Including settings for MVC and Localization