<p>What is the best way to authorize all users to one single page in a asp.net website.</p>

<p>For except the login page and one other page, I deny all users from viewing pages in the website. </p>

<p>How do you make this page accessible to all users?</p>

[{'answer_id': 18469, 'author': 'Dillie-O', 'author_id': 71, 'author_profile': 'https://Stackoverflow.com/users/71', 'pm_score': 4, 'selected': True, 'text': '<p>I\'ve been using forms authentication and creating the necessary GenericIdentity and CustomPrincipal objects that allows me to leverage the User.IsInRole type functions you typically only get with Windows authentication.</p>\n\n<p>That way in my web.config file, I can do stuff like...</p>\n\n<pre><code>&lt;location path="Login.aspx"&gt;\n   &lt;system.web&gt;\n      &lt;authorization&gt;\n         &lt;allow users ="*" /&gt;\n      &lt;/authorization&gt;\n   &lt;/system.web&gt;\n&lt;/location&gt;\n\n&lt;location path="ManagementFolder"&gt;\n   &lt;system.web&gt;\n      &lt;authorization&gt;\n         &lt;allow roles ="Administrator, Manager" /&gt;\n      &lt;/authorization&gt;\n   &lt;/system.web&gt;\n&lt;/location&gt;\n</code></pre>\n'}, {'answer_id': 18475, 'author': 'Louis Salin', 'author_id': 160, 'author_profile': 'https://Stackoverflow.com/users/160', 'pm_score': -1, 'selected': False, 'text': '<p>I created a base "page" class that handles that sort of thing. All my pages can then be decorated with the RequiresLogin attribute if a login is required to view them. If the attribute is not present, the page is accessible to all.</p>\n\n<p>Example:</p>\n\n<pre><code>&lt;RequiresLogin()&gt; _ \n&lt;RequiresPermission("process")&gt; _\nPartial Class DesignReviewEditProgressPage\n    Inherits MyPage \'which inherits System.Web.UI.Page and deal with logins itself\n\n    ...\nEnd Class\n</code></pre>\n\n<p>The MyPage class checks what attributes are being tagged to itself and if RequiresLogin is present, it forwards you to a login page.</p>\n\n<p>I believe this could be adapted to fit your own problem.</p>\n'}]
['https://Stackoverflow.com/questions/18460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2172/']