Omegapoint / rest-sec-net

Course on secure REST API in ASP.NET Core 2, C#
MIT License
1 stars 0 forks source link

Lägg till ett Authorize-attribut på ProductsController #4

Closed TobiasAhnoff closed 4 years ago

TobiasAhnoff commented 4 years ago

Authorize-attribut kan läggas in i Controller också, jag tycker det är tydligt och bra att även om vi också har authfiltret, bra att snabbt kunna se på en controller att inga anonyma anrop tillåts, i fall man skulle ha missat att får med filtret i startup.cs...

altenstedt commented 4 years ago

Adding an authorize attribute to all controllers also makes the purpose of the RequireAuthenticatedUser policy a little less clear, IMHO. If we have Authorize on all controllers, then we do not need that policy.

TobiasAhnoff commented 4 years ago

We will show and talk (briefly) about MVC Authorization policies in demo 1 (no code change needed)