Is it possible to authorize pure HTML files with ASP.NET?
Currently our application uses ASP.NET Web API
at server side and AngularJS
at client side with "glue" layer of ASP.NET MVC
with Razor
. We consider eliminating the MVC & Razor layer completely for:
- not having a mix of 2 syntaxes above HTML - both Razor and Angular (at least no need to choose between the two when both can do the job)
- ability to completely extract client side from the solution and probably even use another IDE
- ability to easily replace ASP.NET Web API with a different server
Migration from Razor (asp.net) to Angular JS as a template engine - covers most Razor usages, but authorization. And this explains how to hide HTML pages for non-authenticated users - How to do Forms Authentication on purely HTML pages using ASP.NET?.
Is it possible in ASP.NET to serve HTML pages based on user roles? Probably it's enough to apply authorization for Web API only (which we already do), as raw pages doesn't have any sensitive content.