Skip to content

Commit cd456d7

Browse files
Add the required DbContexts in one call in the OpenIddict IDP sample as well as pruning old artifacts using Quartz.
1 parent 02ab145 commit cd456d7

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
@@ -119,20 +119,15 @@ public void ConfigureServices(IServiceCollection services)
119119
{
120120
//use quartz to prune old SAML messages every 14 days.
121121
builder.PruneSamlMessages();
122+
builder.PruneSamlArtifacts();
122123

123124
//Already added the DbContext above
124125
builder.UseSamlEntityFrameworkCore()
125-
.AddSamlMessageDbContext(optionsBuilder =>
126-
{
127-
//Configure the database provider to use.
128-
optionsBuilder.UseSqlServer(defaultConnectionString, x =>x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
129-
})
130-
.AddSamlConfigurationDbContext(optionsBuilder =>
131-
{
132-
//Configure the database provider to use.
133-
optionsBuilder.UseSqlServer(defaultConnectionString,
134-
x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
135-
});
126+
.AddSamlDbContexts(optionsBuilder =>
127+
{
128+
//Configure the database provider to use.
129+
optionsBuilder.UseSqlServer(defaultConnectionString, x => x.MigrationsAssembly(typeof(Startup).Assembly.FullName));
130+
});
136131

137132
builder.ConfigureSamlOpenIddictServerOptions(serverOptions =>
138133
{

0 commit comments

Comments
 (0)