Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

halter73
Copy link
Member

  • We've now replaced IApiEndpointMetadata with IDisableCookieRedirectMetadata
  • We also added IAllowCookieRedirectMetadata and corresponding extension methods
  • We only added one attribute, [AllowCookieRedirect] for now, since [ApiController] adds IDisableCookieRedirectMetadata already
  • Add's an AppContext swithc to revert to the old behavior and ignore metadata called "Microsoft.AspNetCore.Authentication.Cookies.IgnoreRedirectMetadata"

Fixes #62883

- We've now added IDisableCookieRedirectMetadata, IAllowCookieRedirectMetadata
  and corresponding extension methods
- We only added one attribute, [AllowCookieRedirect] for now, since [ApiController]
  adds IDisableCookieRedirectMetadata already
- Add's an AppContext swithc to revert to the old behavior and ignore metadata
  called "Microsoft.AspNetCore.Authentication.Cookies.IgnoreRedirectMetadata"
@Copilot Copilot AI review requested due to automatic review settings August 15, 2025 19:22
@github-actions github-actions bot added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Aug 15, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses API review feedback by replacing the previous IApiEndpointMetadata interface with more specific cookie redirect metadata interfaces. The changes introduce IDisableCookieRedirectMetadata and IAllowCookieRedirectMetadata to provide fine-grained control over cookie-based authentication redirect behavior, along with an AppContext switch for backward compatibility.

  • Replaces IApiEndpointMetadata with IDisableCookieRedirectMetadata throughout the codebase
  • Adds IAllowCookieRedirectMetadata to override disable behavior when needed
  • Introduces AllowCookieRedirectAttribute and extension methods for easy configuration
  • Adds AppContext switch "Microsoft.AspNetCore.Authentication.Cookies.IgnoreRedirectMetadata" to revert to old behavior

Reviewed Changes

Copilot reviewed 114 out of 114 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Http/Http.Abstractions/src/Metadata/IApiEndpointMetadata.cs Removed old interface
src/Http/Http.Abstractions/src/Metadata/IDisableCookieRedirectMetadata.cs New interface for disabling cookie redirects
src/Http/Http.Abstractions/src/Metadata/IAllowCookieRedirectMetadata.cs New interface for allowing cookie redirects
src/Security/Authentication/Cookies/src/CookieAuthenticationEvents.cs Updated logic to use new metadata interfaces with AppContext switch
src/Http/Http.Extensions/src/CookieRedirectEndpointConventionBuilderExtensions.cs New extension methods for configuring redirect behavior
src/Http/Http.Extensions/src/AllowCookieRedirectAttribute.cs New attribute implementing IAllowCookieRedirectMetadata
Multiple test files Updated test assertions to use new interface names
Multiple source files Replaced ApiEndpointMetadata.Instance with DisableCookieRedirectMetadata.Instance

src/Security/Authentication/test/CookieTests.cs Outdated Show resolved Hide resolved
src/Security/Authentication/test/CookieTests.cs Outdated Show resolved Hide resolved
halter73 and others added 3 commits August 15, 2025 12:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@halter73 halter73 enabled auto-merge (squash) August 15, 2025 21:44
@halter73 halter73 merged commit 89bd338 into main Aug 16, 2025
29 checks passed
@halter73 halter73 deleted the halter73/62883 branch August 16, 2025 00:55
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0-rc1 milestone Aug 16, 2025
wtgodbe added a commit that referenced this pull request Aug 18, 2025
* Avoid race that can cause Kestrel's RequestAborted to not fire (#62385)

* Send Keep-Alive Ping Immediately When Previous Ping Is Overdue (#63195)

* Make new validations consistent with System.ComponentModel.DataAnnotations behavior (#63231)

* Add support for type-level validation attributes, update validation ordering

* Code review fix, test fix

* Fix trimming annotation

* Fix trimming annotation

* Separate caches for property and type attributes

* Fix typo

Co-authored-by: Brennan <brecon@microsoft.com>

* Fix typo

Co-authored-by: Brennan <brecon@microsoft.com>

* Fix and simplify the emitted code

* Update src/Validation/test/Microsoft.Extensions.Validation.GeneratorTests/ValidationsGeneratorTestBase.cs

---------

Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>

* Search for slnx files when setting solution-relative content root (#61305)

* Address API review feedback for what was IApiEndpointMetadata (#63283)

---------

Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Reagan Yuan <reaganyuan27@gmail.com>
Co-authored-by: Ondřej Roztočil <roztocil@outlook.com>
Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>
Co-authored-by: Jacob Bundgaard <jbu@templafy.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Proposal for IApiEndpointMetadata

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.