Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<PackageVersion Include="MailKit" Version="4.9.0" />
<PackageVersion Include="Markdig" Version="0.39.1" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.9.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.5.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.3.0" />
<PackageVersion Include="Microsoft.Identity.Web" Version="3.8.0" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="8.6.1" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="MimeKit" Version="4.9.0" />
Expand All @@ -49,12 +49,12 @@
<PackageVersion Include="NJsonSchema" Version="11.1.0" />
<PackageVersion Include="NLog.Web.AspNetCore" Version="5.3.15" />
<PackageVersion Include="NodaTime" Version="3.2.1" />
<PackageVersion Include="OpenIddict.Core" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Server.AspNetCore" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Server.DataProtection" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Validation.AspNetCore" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Validation.DataProtection" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Validation.SystemNetHttp" Version="6.0.0" />
<PackageVersion Include="OpenIddict.Core" Version="6.1.1" />
<PackageVersion Include="OpenIddict.Server.AspNetCore" Version="6.1.1" />
<PackageVersion Include="OpenIddict.Server.DataProtection" Version="6.1.1" />
<PackageVersion Include="OpenIddict.Validation.AspNetCore" Version="6.1.1" />
<PackageVersion Include="OpenIddict.Validation.DataProtection" Version="6.1.1" />
<PackageVersion Include="OpenIddict.Validation.SystemNetHttp" Version="6.1.1" />
<PackageVersion Include="OrchardCore.Translations.All" Version="2.1.0" />
<PackageVersion Include="PdfPig" Version="0.1.9" />
<PackageVersion Include="Shortcodes" Version="1.3.5" />
Expand Down Expand Up @@ -143,7 +143,7 @@
<PackageVersion Include="Microsoft.AspNetCore.Authorization" Version="9.0.2" />

<!-- dotnet/extensions repository -->
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.1.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="9.2.0" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: bumping that dependency was required as OpenIddict references the 9.2.0 version of that package.


<!-- Serilog.AspNetCore -->
<PackageVersion Include="Serilog.AspNetCore" Version="9.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,12 @@ public void Configure(OpenIddictServerOptions options)
options.Scopes.Add(Scopes.Phone);
options.Scopes.Add(Scopes.Profile);
options.Scopes.Add(Scopes.Roles);

// Note: caching is enabled for both authorization and end session requests to allow sending
// large POST authorization and end session requests, but can be programmatically disabled, as the
// authorization and end session views support flowing the entire payload and not just the request_uri.
options.EnableAuthorizationRequestCaching = true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: these options were moved to OpenIddictServerOptions (instead of OpenIddictServerAspNetCoreOptions) as part of the OAuth 2.0 Pushed Authorization Requests introduction. The old properties are still there but obsolete and no-op.

options.EnableEndSessionRequestCaching = true;
}

public void Configure(OpenIddictServerDataProtectionOptions options)
Expand All @@ -202,12 +208,6 @@ public void Configure(string name, OpenIddictServerAspNetCoreOptions options)
options.EnableTokenEndpointPassthrough = true;
options.EnableUserInfoEndpointPassthrough = true;

// Note: caching is enabled for both authorization and end session requests to allow sending
// large POST authorization and end session requests, but can be programmatically disabled, as the
// authorization and end session views support flowing the entire payload and not just the request_id.
options.EnableAuthorizationRequestCaching = true;
options.EnableEndSessionRequestCaching = true;

// Note: error pass-through is enabled to allow the actions of the MVC authorization controller
// to handle the errors returned by the interactive endpoints without relying on the generic
// status code pages middleware to rewrite the response later in the request processing.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ public async Task<IActionResult> Authorize()
return View(new AuthorizeViewModel
{
ApplicationName = await _applicationManager.GetLocalizedDisplayNameAsync(application),
RequestId = request.RequestId,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: OpenIddictRequest.RequestId is obsolete in OpenIddict 6.1.0+ (the request caching feature now uses request_uri) but that property wasn't used anywhere so I decided to remove it.

Scope = request.Scope
});
}
Expand Down Expand Up @@ -327,10 +326,7 @@ public async Task<IActionResult> Logout()
}
}

return View(new LogoutViewModel
{
RequestId = request.RequestId
});
return View();
}

[ActionName(nameof(Logout)), AllowAnonymous, DisableCors]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ public class AuthorizeViewModel
{
public string ApplicationName { get; set; }

public string RequestId { get; set; }

public string Scope { get; set; }
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
@using Microsoft.Extensions.Primitives
@using OrchardCore.OpenId.ViewModels
@model LogoutViewModel

@{
ViewLayout = "Layout__Login";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,10 @@ public virtual async ValueTask<long> PruneAsync(DateTimeOffset threshold, Cancel

var authorizations = (await _session.Query<TAuthorization, OpenIdAuthorizationIndex>(
authorization => authorization.CreationDate < threshold.UtcDateTime &&
(authorization.Status != OpenIddictConstants.Statuses.Valid ||
(authorization.Type == OpenIddictConstants.AuthorizationTypes.AdHoc &&
(authorization.Status != Statuses.Valid || authorization.Type == AuthorizationTypes.AdHoc) &&
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: that behavior change is deliberate: openiddict/openiddict-core#2251.

authorization.AuthorizationId.IsNotIn<OpenIdTokenIndex>(
token => token.AuthorizationId,
token => token.Id != 0))),
token => token.Id != 0),
collection: OpenIdCollection).Take(100).ListAsync()).ToList();

if (authorizations.Count is 0)
Expand Down