Skip to content

Commit

Permalink
Update the samples to register the OpenIddict/Quartz.NET integration
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed May 13, 2021
1 parent c21aac4 commit ae4785e
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
<PackageReference Update="OpenIddict.Abstractions" Version="3.0.4" />
<PackageReference Update="OpenIddict.EntityFrameworkCore" Version="3.0.4" />
<PackageReference Update="OpenIddict.Owin" Version="3.0.4" />
<PackageReference Update="OpenIddict.Quartz" Version="3.0.4" />
<PackageReference Update="OpenIddict.Validation.AspNetCore" Version="3.0.4" />
<PackageReference Update="OpenIddict.Validation.SystemNetHttp" Version="3.0.4" />
<PackageReference Update="Quartz.Extensions.Hosting" Version="3.2.4" />
<PackageReference Update="System.Net.Http.Json" Version="5.0.0" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions samples/Aridka/Aridka.Server/Aridka.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Aridka/Aridka.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Quartz;

namespace Aridka.Server
{
Expand All @@ -28,6 +29,18 @@ public void ConfigureServices(IServiceCollection services)
options.UseOpenIddict();
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -37,6 +50,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
2 changes: 2 additions & 0 deletions samples/Balosar/Balosar.Server/Balosar.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Balosar/Balosar.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace Balosar.Server
Expand Down Expand Up @@ -44,6 +45,18 @@ public void ConfigureServices(IServiceCollection services)
options.ClaimsIdentity.RoleClaimType = Claims.Role;
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -53,6 +66,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
2 changes: 2 additions & 0 deletions samples/Hollastin/Hollastin.Server/Hollastin.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Hollastin/Hollastin.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace Hollastin.Server
Expand Down Expand Up @@ -46,6 +47,18 @@ public void ConfigureServices(IServiceCollection services)
options.ClaimsIdentity.RoleClaimType = Claims.Role;
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -55,6 +68,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
2 changes: 2 additions & 0 deletions samples/Imynusoph/Imynusoph.Server/Imynusoph.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Imynusoph/Imynusoph.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace Imynusoph.Server
Expand Down Expand Up @@ -48,6 +49,18 @@ public void ConfigureServices(IServiceCollection services)
options.ClaimsIdentity.RoleClaimType = Claims.Role;
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -57,6 +70,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
16 changes: 16 additions & 0 deletions samples/Velusia/Velusia.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Quartz;
using Velusia.Server.Data;
using static OpenIddict.Abstractions.OpenIddictConstants;

Expand Down Expand Up @@ -57,6 +58,18 @@ public void ConfigureServices(IServiceCollection services)
options.SignIn.RequireConfirmedAccount = false;
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -66,6 +79,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
4 changes: 3 additions & 1 deletion samples/Velusia/Velusia.Server/Velusia.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
Expand All @@ -15,6 +15,8 @@
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Weytta/Weytta.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;

namespace Weytta.Server
Expand All @@ -24,6 +25,18 @@ public void ConfigureServices(IServiceCollection services)
options.UseOpenIddict();
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

// Register the Negotiate handler (when running on IIS, it will automatically
// delegate the actual Integrated Windows Authentication process to IIS).
services.AddAuthentication()
Expand All @@ -38,6 +51,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<DbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
2 changes: 2 additions & 0 deletions samples/Weytta/Weytta.Server/Weytta.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions samples/Zirku/Zirku.Server/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Tokens;
using Quartz;
using Zirku.Server.Models;
using Zirku.Server.Services;
using static OpenIddict.Abstractions.OpenIddictConstants;
Expand Down Expand Up @@ -44,6 +45,18 @@ public void ConfigureServices(IServiceCollection services)
options.ClaimsIdentity.RoleClaimType = Claims.Role;
});

// OpenIddict offers native integration with Quartz.NET to perform scheduled tasks
// (like pruning orphaned authorizations/tokens from the database) at regular intervals.
services.AddQuartz(options =>
{
options.UseMicrosoftDependencyInjectionJobFactory();
options.UseSimpleTypeLoader();
options.UseInMemoryStore();
});

// Register the Quartz.NET service and configure it to block shutdown until jobs are complete.
services.AddQuartzHostedService(options => options.WaitForJobsToComplete = true);

services.AddOpenIddict()

// Register the OpenIddict core components.
Expand All @@ -53,6 +66,9 @@ public void ConfigureServices(IServiceCollection services)
// Note: call ReplaceDefaultEntities() to replace the default OpenIddict entities.
options.UseEntityFrameworkCore()
.UseDbContext<ApplicationDbContext>();

// Enable Quartz.NET integration.
options.UseQuartz();
})

// Register the OpenIddict server components.
Expand Down
2 changes: 2 additions & 0 deletions samples/Zirku/Zirku.Server/Zirku.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
<PackageReference Include="OpenIddict.AspNetCore" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" />
<PackageReference Include="OpenIddict.Quartz" />
<PackageReference Include="Quartz.Extensions.Hosting" />
</ItemGroup>

</Project>

0 comments on commit ae4785e

Please sign in to comment.