scalf Posted February 14, 2005 Posted February 14, 2005 Hello everybody, I'm using a secured access to my website using specific tags in my web.config file such as : <authentication mode="Forms"> <forms name=".ASPXFIDEXEC" loginUrl="login.aspx" protection="All" timeout="60" /> </authentication> The problem is that there is one page that would like users to access without having to Log In. Can I add exceptions to avoid my web.config to redirect me automatically to the login.aspx page ? Thanks in advance! Quote Scalf. Do not want others to know what you have done? Better not have done it anyways.
ombun2 Posted February 14, 2005 Posted February 14, 2005 Read up on the <location> section. I can't recall all the details right now, but you'd create a <location> section with <system.web> and <authorization> subsections for each secure page in your app. you indicate the page by using the "path" attribute in your <location> marker. you can have multiple <location> sections and you'd put them in between the <configuration> markers of your web.config file. in order to process these special pages first I think you have to put them before the default <system.web> that's already in the file. so something like this <configuration> <location path="food.aspx"> <system.web> <authorization> ~~!@@ </authorization> </system.web> </location> <location path="games.aspx"> <system.web> <authorization> ~~!@@ </authorization> </system.web> </location> <system.web> <authorization> </authorization> </system.web> </configuration> success (oh great i indented but it won't show...oh well) Quote
Administrators PlausiblyDamp Posted February 14, 2005 Administrators Posted February 14, 2005 IIRC within the configuration section of your web.config you can add a location element and set it's path attribute to either a sub folder or an aspx page. Within that you can use most of the standard web.config elements including authorization i.e. given a page with the catchy name of AnyOneCanAccessThisPage.aspx you should be able to use the following snippet. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
scalf Posted February 15, 2005 Author Posted February 15, 2005 Many thanks It works fine. I added a location section for the page I wanted to exclude from my secured web space and added also a <location> </location> section for the secured part of my web site (no path parameters for this location part). Many thanks to all the friendly guys how helped me solve this problem!!! ;) IIRC within the configuration section of your web.config you can add a location element and set it's path attribute to either a sub folder or an aspx page. Within that you can use most of the standard web.config elements including authorization i.e. given a page with the catchy name of AnyOneCanAccessThisPage.aspx you should be able to use the following snippet. <location path="AnyOneCanAccessThisPage.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> </location> Quote Scalf. Do not want others to know what you have done? Better not have done it anyways.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.