Skip to content

Commit 1963a85

Browse files
Add the required DbContexts in one call in the OpenIddict IDP sample as well as pruning old artifacts using Quartz.
1 parent 402fc2c commit 1963a85

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

OpenIddict/OpenIddictIdP/Startup.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,20 +123,15 @@ public void ConfigureServices(IServiceCollection services)
123123
{
124124
//use quartz to prune old SAML messages every 14 days.
125125
builder.PruneSamlMessages();
126+
builder.PruneSamlArtifacts();
126127

127128
//Already added the DbContext above
128129
builder.UseSamlEntityFrameworkCore()
129-
.AddSamlMessageDbContext(optionsBuilder =>
130-
{
131-
//Configure the database provider to use.
132-
optionsBuilder.UseSqlServer(defaultConnectionString, x =>x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
133-
})
134-
.AddSamlConfigurationDbContext(optionsBuilder =>
135-
{
136-
//Configure the database provider to use.
137-
optionsBuilder.UseSqlServer(defaultConnectionString,
138-
x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
139-
});
130+
.AddSamlDbContexts(optionsBuilder =>
131+
{
132+
//Configure the database provider to use.
133+
optionsBuilder.UseSqlServer(defaultConnectionString, x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
134+
});
140135

141136
builder.ConfigureSamlOpenIddictServerOptions(serverOptions =>
142137
{

0 commit comments

Comments
 (0)