In your web.config file you need to add the following
<authentication mode="Forms"> <forms loginUrl="YOUR LOGIN PAGE!!" timeout="2880" /> </authentication>
in the <system.web /> .
This will force the user to authenticate for this site.
The [Authorize] attribute is used to require user authentication (for example, you have posed your question), BUT !! for MVC applications only http://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute.aspx
With MVC, you can also use the [RequiresAuthentication(Roles = "admin")] attribute, which will give you control over which clips have access to endpoints.
I would seriously consider MVC
source share