diff --git a/Directory.Packages.props b/Directory.Packages.props
index b50fe7f0..98c84489 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -15,6 +15,8 @@
+
+
diff --git a/NuGet.config b/NuGet.config
index e94c8f75..6f4cb7ad 100644
--- a/NuGet.config
+++ b/NuGet.config
@@ -1,6 +1,7 @@
+
diff --git a/OpenIddict.sln b/OpenIddict.sln
index b5a3c2a8..7e3f8cf0 100644
--- a/OpenIddict.sln
+++ b/OpenIddict.sln
@@ -107,6 +107,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{
.github\workflows\build.yml = .github\workflows\build.yml
EndProjectSection
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenIddict.Server.Quartz", "src\OpenIddict.Server.Quartz\OpenIddict.Server.Quartz.csproj", "{FD150A90-1997-45C7-9EBE-7C6E62E464E8}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIddict.Server.Quartz.Tests", "test\OpenIddict.Server.Quartz.Tests\OpenIddict.Server.Quartz.Tests.csproj", "{01420929-33B8-4B60-A618-8C8B5F139630}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -245,6 +249,14 @@ Global
{D94B10D3-3DD3-4829-B305-17C48833AB33}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D94B10D3-3DD3-4829-B305-17C48833AB33}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D94B10D3-3DD3-4829-B305-17C48833AB33}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FD150A90-1997-45C7-9EBE-7C6E62E464E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FD150A90-1997-45C7-9EBE-7C6E62E464E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FD150A90-1997-45C7-9EBE-7C6E62E464E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FD150A90-1997-45C7-9EBE-7C6E62E464E8}.Release|Any CPU.Build.0 = Release|Any CPU
+ {01420929-33B8-4B60-A618-8C8B5F139630}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {01420929-33B8-4B60-A618-8C8B5F139630}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {01420929-33B8-4B60-A618-8C8B5F139630}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {01420929-33B8-4B60-A618-8C8B5F139630}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -283,6 +295,8 @@ Global
{FBFDB9E2-4A44-4B90-B896-E094BFC05C03} = {5FC71D6A-A994-4F62-977F-88A7D25379D7}
{E62124D4-3660-4590-B4D1-787168BBBEDD} = {5FC71D6A-A994-4F62-977F-88A7D25379D7}
{D94B10D3-3DD3-4829-B305-17C48833AB33} = {5FC71D6A-A994-4F62-977F-88A7D25379D7}
+ {FD150A90-1997-45C7-9EBE-7C6E62E464E8} = {D544447C-D701-46BB-9A5B-C76C612A596B}
+ {01420929-33B8-4B60-A618-8C8B5F139630} = {5FC71D6A-A994-4F62-977F-88A7D25379D7}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A710059F-0466-4D48-9B3A-0EF4F840B616}
diff --git a/samples/Mvc.Server/Mvc.Server.csproj b/samples/Mvc.Server/Mvc.Server.csproj
index dbfe1de7..5e76d4a6 100644
--- a/samples/Mvc.Server/Mvc.Server.csproj
+++ b/samples/Mvc.Server/Mvc.Server.csproj
@@ -10,11 +10,13 @@
+
+
diff --git a/samples/Mvc.Server/Startup.cs b/samples/Mvc.Server/Startup.cs
index 7051d4f3..7822d5f2 100644
--- a/samples/Mvc.Server/Startup.cs
+++ b/samples/Mvc.Server/Startup.cs
@@ -5,6 +5,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Mvc.Server.Models;
using Mvc.Server.Services;
+using Quartz;
using static OpenIddict.Abstractions.OpenIddictConstants;
namespace Mvc.Server
@@ -46,6 +47,18 @@ namespace Mvc.Server
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.
@@ -97,6 +110,9 @@ namespace Mvc.Server
.EnableVerificationEndpointPassthrough()
.DisableTransportSecurityRequirement(); // During development, you can disable the HTTPS requirement.
+ // Enable Quartz.NET integration.
+ options.UseQuartz();
+
// Note: if you don't want to specify a client_id when sending
// a token or revocation request, uncomment the following line:
//
diff --git a/src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx b/src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx
index e707e673..92883256 100644
--- a/src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx
+++ b/src/OpenIddict.Abstractions/Resources/OpenIddictResources.resx
@@ -480,6 +480,11 @@ Consider using 'options.AddSigningCredentials(SigningCredentials)' instead.Endpoint addresses cannot start with '{0}'.
{Locked}
+
+ Dependency injection support must be enabled in Quartz.NET when using the OpenIddict server integration.
+To enable DI support, call 'services.AddQuartz(options => options.UseMicrosoftDependencyInjectionJobFactory())'.
+ {Locked}
+
Reference tokens cannot be used when disabling token storage.{Locked}
@@ -1363,6 +1368,15 @@ To register the Entity Framework Core stores, reference the 'OpenIddict.EntityFr
Consider creating non-generic classes derived from the default entities for the application, authorization, scope and token entities.
{Locked}
+
+ The core services must be registered when enabling the OpenIddict server Quartz.NET integration.
+To register the OpenIddict core services, reference the 'OpenIddict.Core' package and call 'services.AddOpenIddict().AddCore()' from 'ConfigureServices'.
+ {Locked}
+
+
+ The maximum refire count cannot be negative.
+ {Locked}
+
The security token is missing.
@@ -2469,4 +2483,10 @@ This may indicate that the hashed entry is corrupted or malformed.
An exception occurred while trying to revoke the token '{Identifier}'.{Locked}
+
+ Removes orphaned tokens and authorizations from the database.
+
+
+ Starts the scheduled task at regular intervals.
+
\ No newline at end of file
diff --git a/src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf b/src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf
index fe832d0b..3bbe33b0 100644
--- a/src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf
+++ b/src/OpenIddict.Abstractions/Resources/xlf/OpenIddictResources.fr.xlf
@@ -587,6 +587,16 @@
Les URLs de rappel doit être des URLs valides et absolues.
+
+ Removes orphaned tokens and authorizations from the database.
+ Supprime les jetons et autorisations orphelines de la base de données.
+
+
+
+ Starts the scheduled task at regular intervals.
+ Démarre la tâche planifiée à intervalles réguliers.
+
+