Skip to content

Commit

Permalink
Changed the order number of the middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Klaus committed Mar 24, 2024
1 parent 6e3f536 commit 1f5a47f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions OpenIdDict.Server/Authorisation/OpenIdDictTokenResolving.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public CodeReferenceTokenStorageHandler(IMemoryCache memoryCache)
= OpenIddictServerHandlerDescriptor.CreateBuilder<OpenIddictServerEvents.GenerateTokenContext>()
.AddFilter<RequireDegradedModeEnabled>()
.UseScopedHandler<CodeReferenceTokenStorageHandler>()
.SetOrder(OpenIddictServerHandlers.Protection.GenerateIdentityModelToken.Descriptor.Order + 2_000)
.SetOrder(OpenIddictServerHandlers.Protection.GenerateIdentityModelToken.Descriptor.Order + 990)
.SetType(OpenIddictServerHandlerType.BuiltIn)
.Build();

Expand Down Expand Up @@ -87,7 +87,7 @@ public ValidateCodeReferenceTokenHandler(IMemoryCache memoryCache)
= OpenIddictServerHandlerDescriptor.CreateBuilder<OpenIddictServerEvents.ValidateTokenContext>()
.AddFilter<RequireDegradedModeEnabled>()
.UseScopedHandler<ValidateCodeReferenceTokenHandler>()
.SetOrder(OpenIddictServerHandlers.Protection.ResolveTokenValidationParameters.Descriptor.Order + 2_000)
.SetOrder(OpenIddictServerHandlers.Protection.ResolveTokenValidationParameters.Descriptor.Order + 990)
.SetType(OpenIddictServerHandlerType.BuiltIn)
.Build();

Expand Down
2 changes: 1 addition & 1 deletion OpenIdDict.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ policyBuilder .AllowAnyOrigin()
})
.UseAuthentication()
.UseAuthorization(); // Note 1: 'Authorization' is required only if the project has secured end-points
// Note 2: the Authorization middleware must be register AFTER the Authentication middleware
// Note 2: the Authorization middleware must be registered AFTER the Authentication middleware
app.MapTestRoutes();

if (isLocal)
Expand Down

0 comments on commit 1f5a47f

Please sign in to comment.