Skip to content

Commit

Permalink
Merge pull request #5 from skoruba/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
b0 authored Dec 18, 2019
2 parents 6b00ae9 + de65929 commit db13a3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ public static void AddAuthenticationServices<TConfigurationDbContext, TPersisted
var authenticationBuilder = services.AddAuthentication();

AddExternalProviders(authenticationBuilder, configuration);

AddIdentityServer<TConfigurationDbContext, TPersistedGrantDbContext, TUserIdentity>(services, configuration);
}

/// <summary>
Expand Down Expand Up @@ -311,8 +309,8 @@ private static RegisterConfiguration GetRegistrationConfiguration(IConfiguration
/// <typeparam name="TPersistedGrantDbContext"></typeparam>
/// <param name="services"></param>
/// <param name="configuration"></param>
private static void AddIdentityServer<TConfigurationDbContext, TPersistedGrantDbContext, TUserIdentity>(
IServiceCollection services,
public static IIdentityServerBuilder AddIdentityServer<TConfigurationDbContext, TPersistedGrantDbContext, TUserIdentity>(
this IServiceCollection services,
IConfiguration configuration)
where TPersistedGrantDbContext : DbContext, IAdminPersistedGrantDbContext
where TConfigurationDbContext : DbContext, IAdminConfigurationDbContext
Expand All @@ -331,6 +329,8 @@ private static void AddIdentityServer<TConfigurationDbContext, TPersistedGrantDb

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

return builder;
}

/// <summary>
Expand Down
7 changes: 5 additions & 2 deletions src/Skoruba.IdentityServer4.STS.Identity/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, AdminIdentityDbContext, UserIdentity, UserIdentityRole>(Configuration);
// Add services for authentication, including Identity model and external providers
services.AddAuthenticationServices<IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, AdminIdentityDbContext, UserIdentity, UserIdentityRole>(Configuration);

// Add services for IdentityServer4
services.AddIdentityServer<IdentityServerConfigurationDbContext, IdentityServerPersistedGrantDbContext, UserIdentity>(Configuration);

// Add all dependencies for Asp.Net Core Identity in MVC - these dependencies are injected into generic Controllers
// Including settings for MVC and Localization
Expand Down

0 comments on commit db13a3b

Please sign in to comment.