Use dedicated controllers for mixed attributes (#18879)

* Use dedicated controllers for mixed attributes

* Update aspnetcore/security/authorization/simple.md

Co-authored-by: Pranav K <prkrishn@hotmail.com>

Co-authored-by: Pranav K <prkrishn@hotmail.com>
pull/18970/head
Rick Anderson 2020-06-25 15:15:08 -10:00 committed by GitHub
parent 43ae480ffc
commit d26d4aad43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -73,7 +73,7 @@ This would allow only authenticated users to the `AccountController`, except for
## Authorize attribute and Razor Pages ## Authorize attribute and Razor Pages
The <xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute> can ***not*** be applied to Razor Page handlers. For example, `[Authorize]` can't be applied to `OnGet`, `OnPost`, or any other page handler. The <xref:Microsoft.AspNetCore.Authorization.AuthorizeAttribute> can ***not*** be applied to Razor Page handlers. For example, `[Authorize]` can't be applied to `OnGet`, `OnPost`, or any other page handler. Consider using an ASP.NET Core MVC controller for pages with different authorization requirements for different handlers.
The following two approaches can be used to apply authorization to Razor Page handler methods: The following two approaches can be used to apply authorization to Razor Page handler methods: