I am having a hard time to understand real use of [Authorize]
attribute in ASP.NET MVC. As per the concept goes, if we decorate a controller method with [Authorize]
attribute, only authenticated users are allowed to access the controllers.
I have developed an ASP.NET MVC application without decorating controllers with [Authorize]
attribute. What I have observed is, if I implement authentication mechanism properly in my application using web.config or some other way, noway I can access the URL {controller}/{action}/{id}
of a particular action method.
System always ask for login. That means my Controllers are secured. My question is this, when I can secure my controllers without using [Authorize]
attribute, then what is the real need of it?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…