diff --git a/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ShellFeature.cs b/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ShellFeature.cs index a09f2658b..ed132caf7 100644 --- a/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ShellFeature.cs +++ b/src/modules/Elsa.Persistence.EFCore/Modules/Identity/ShellFeature.cs @@ -14,6 +14,7 @@ public abstract class EFCoreIdentityPersistenceShellFeatureBase : PersistenceShe { protected override void OnConfiguring(IServiceCollection services) { + services.AddExternalAuthenticationEntityFrameworkCore(); services.AddScoped(); services.AddScoped(); services.AddScoped(); diff --git a/test/integration/Elsa.ExternalAuthentication.IntegrationTests/Persistence/ExternalAuthenticationPersistenceRegistrationTests.cs b/test/integration/Elsa.ExternalAuthentication.IntegrationTests/Persistence/ExternalAuthenticationPersistenceRegistrationTests.cs index 0077a0235..92fdb3088 100644 --- a/test/integration/Elsa.ExternalAuthentication.IntegrationTests/Persistence/ExternalAuthenticationPersistenceRegistrationTests.cs +++ b/test/integration/Elsa.ExternalAuthentication.IntegrationTests/Persistence/ExternalAuthenticationPersistenceRegistrationTests.cs @@ -1,5 +1,7 @@ using Elsa.ExternalAuthentication.Contracts; using Elsa.ExternalAuthentication.Services; +using Elsa.Persistence.EFCore.Modules.ExternalAuthentication; +using Elsa.Persistence.EFCore.Sqlite.ShellFeatures.Identity; using Microsoft.Extensions.DependencyInjection; namespace Elsa.ExternalAuthentication.IntegrationTests.Persistence; @@ -17,4 +19,22 @@ public class ExternalAuthenticationPersistenceRegistrationTests Assert.IsType( serviceProvider.GetRequiredService()); } + + [Fact] + public void SqliteIdentityShellFeatureUsesEntityFrameworkCoreForExternalAuthentication() + { + var services = new ServiceCollection(); + services.AddExternalAuthenticationServices(); + + var feature = new SqliteIdentityPersistenceShellFeature + { + ConnectionString = "Data Source=:memory:" + }; + feature.ConfigureServices(services); + + var registration = services.Last(x => x.ServiceType == typeof(IIdentityProviderConnectionStore)); + + Assert.Equal(typeof(EFCoreIdentityProviderConnectionStore), registration.ImplementationType); + Assert.Equal(ServiceLifetime.Scoped, registration.Lifetime); + } }