Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Antiforgery to Middleware order and Built-in middleware sections #32565

Open
mmarinchenko opened this issue May 11, 2024 · 8 comments
Open
Labels
aspnet-core/svc fundamentals/subsvc Source - Docs.ms Docs Customer feedback via GitHub Issue

Comments

@mmarinchenko
Copy link
Contributor

Description

The Antiforgery middleware should be added to request processing pipeline after Routing, Authentication, and Authorization but before Endpoint.

Reference: Migrate from ASP.NET Core in .NET 7 to .NET 8 ->

Page URL

https://learn.microsoft.com/en-us/aspnet/core/fundamentals/middleware/?view=aspnetcore-9.0#middleware-order

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/fundamentals/middleware/index.md

Document ID

3926c686-0ccc-f9fe-ca52-0134612a1623

Article author

@Rick-Anderson

@guardrex
Copy link
Collaborator

Hello @mmarinchenko ... What are you asking for? The content is already present in the sections.

@mmarinchenko
Copy link
Contributor Author

@guardrex The Antiforgery middleware depends on the order in which it is added to the request processing pipeline (as well as Cors, OutputCaching, RequestTimeouts and several others). This is covered in the migration article in Blazor context, but not in the main middleware documentation.

See Page URL in the description: ASP.NET Core Middleware. The reference links are provided for reference only 🙂

@guardrex
Copy link
Collaborator

I see ... but the issue has to be opened from the bottom of that article to get the correct metadata and author ping. Re-open the issue from there, and then the author of that article will address it.

@mmarinchenko
Copy link
Contributor Author

Screen

Descr

@guardrex It was opened right from there (see attached screenshots). The Page URL and Content source URL fields contain correct links to the published document and the source code on GitHub. What exactly is wrong?

@mmarinchenko
Copy link
Contributor Author

@guardrex If you are confused by the Blazor tag, then it was added by @Rick-Anderson, not by me.

@guardrex
Copy link
Collaborator

My bad ...... so much for looking at issues on the phone while OOF! 🙈😆

@guardrex guardrex reopened this May 12, 2024
@guardrex guardrex removed their assignment May 12, 2024
@dotnet dotnet deleted a comment from github-actions bot May 12, 2024
@mmarinchenko
Copy link
Contributor Author

My bad ...... so much for looking at issues on the phone while OOF! 🙈😆

You guys really need to rest sometimes 😅

@guardrex
Copy link
Collaborator

I like to try and respond quickly, but it all went horribly wrong this time. I think I thought that this was about the Middleware doc but opened from the Migration article ... even the "M" in both words (links) might have thrown me off 😈. Looking at these on a phone screen isn't a good experience anyway.

The Middleware in Minimal APIs article makes a mention near the end on where to find more information on the Antiforgery Middleware and cross-links to ...

https://learn.microsoft.com/aspnet/core/security/anti-request-forgery?view=aspnetcore-8.0#afwma

... and that's where there's information about placement (ordering). Rick will determine if/where remarks should go when he sees this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aspnet-core/svc fundamentals/subsvc Source - Docs.ms Docs Customer feedback via GitHub Issue
Projects
None yet
Development

No branches or pull requests

4 participants