How do I provide security to the aspx page I am developing (without using login page, registration page, database....)?
You can use the the <authentication>, <authorization> and <location&tg; elements to restrict permissions on specific pages/folders to certain users. In intranet scenarios, you'll probably use Windows authentication:
<system.web> <authentication mode="Windows" /> <deny users="?" /> <allow users="*" /> </system.web>
Here we allow all non-anonymous users to use the site. Then you can add any number of <location> elements to specify more granular behavior:
<location path="SecurePages/Secure.aspx"> <system.web> <authorization> <deny users="*" /> <allow users="MYDOMAINJohn" /> </authorization> </system.web> </location>
Here we restricted the Secure.aspx page to John, user of the Windows domain MYDOMAIN. IIS should be configured accordingly to allow either Windows integrated (most secure but users must belong to the domain) or basic/digest authentication modes. Definitely, anomymous should NOT be the only option, because nobody will ever be prompted for credentials.
Related Q&A from Daniel Cazzulino
Here Daniel Cazzulino explains how to load a DSL (domain specific language) domain model instance file programmatically. This requires the .NET type ...continue reading
Here we offer a glimpse at 12 of .NET development expert Danny Cazzulino's top ASP.NET questions and answers.continue reading
C# developers should NOT be modifying InitializeComponent method in the code-behind (or any of the variable definitions) by hand.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.