Skip to content

Commit

Permalink
Add the required DbContexts in one call in the OpenIddict IDP sample …
Browse files Browse the repository at this point in the history
…as well as pruning old artifacts using Quartz.
  • Loading branch information
SeanFarrow-RSK committed Dec 13, 2023
1 parent 02ab145 commit cd456d7
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions OpenIddict/OpenIddictIdP/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
{
Expand Down

0 comments on commit cd456d7

Please sign in to comment.