From cd456d77d870026564d4c30210cada51f87de9e8 Mon Sep 17 00:00:00 2001 From: Sean Farrow Date: Wed, 13 Dec 2023 11:00:10 +0000 Subject: [PATCH] Add the required DbContexts in one call in the OpenIddict IDP sample as well as pruning old artifacts using Quartz. --- OpenIddict/OpenIddictIdP/Startup.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/OpenIddict/OpenIddictIdP/Startup.cs b/OpenIddict/OpenIddictIdP/Startup.cs index 5568d81..945dc8b 100644 --- a/OpenIddict/OpenIddictIdP/Startup.cs +++ b/OpenIddict/OpenIddictIdP/Startup.cs @@ -119,20 +119,15 @@ public void ConfigureServices(IServiceCollection services) { //use quartz to prune old SAML messages every 14 days. builder.PruneSamlMessages(); + builder.PruneSamlArtifacts(); //Already added the DbContext above builder.UseSamlEntityFrameworkCore() - .AddSamlMessageDbContext(optionsBuilder => - { - //Configure the database provider to use. - optionsBuilder.UseSqlServer(defaultConnectionString, x =>x.MigrationsAssembly(typeof(Startup).Assembly.FullName)); - }) - .AddSamlConfigurationDbContext(optionsBuilder => - { - //Configure the database provider to use. - optionsBuilder.UseSqlServer(defaultConnectionString, - x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName)); - }); + .AddSamlDbContexts(optionsBuilder => + { + //Configure the database provider to use. + optionsBuilder.UseSqlServer(defaultConnectionString, x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName)); + }); builder.ConfigureSamlOpenIddictServerOptions(serverOptions => {