473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Mixing secure and unsecure pages with Forms Authentication

I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated user and some others, like the home page is not required. I specified the <deny users="?" /> on the web.config, but this is causing ALL pages require the authentication. How can I mix both, without loosing the web.config setup? I know that I can manually check the IsAuthenticated property on pages I want to enforce security, but I have an idea that there is some kind of Page property to specify that is secure, maybe I just dream it

Thanks
Nov 18 '05 #1
4 2637
Search the help files for the <location> element.

It lookes something like this

<location path="Logon.aspx">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>

Usually if you can organize your content in folders representing
different level of security and creating a web.config file for each of
these you are better off, but the Location element will give you the
ultimate flexibiltiy and even more chances to forget to secure something :)

MR. UNDERHILL wrote:
I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated user and some others, like the home page is not required. I specified the <deny users="?" /> on the web.config, but this is causing ALL pages require the authentication. How can I mix both, without loosing the web.config setup? I know that I can manually check the IsAuthenticated property on pages I want to enforce security, but I have an idea that there is some kind of Page property to specify that is secure, maybe I just dream it!
Thanks

Nov 18 '05 #2

When you said that you can "organize your content in folders representing different level of security", do you mean, multiple web applications (virtual directories)? or folders withing the same web application?. I understand that you can have only ONE web.config located at the ROOT of your web application (virtual directory). Could explain me a little bit more your approach

Having the <allow users="?"/> is going to allow ALL unauthenticated users to get access to ALL pages, which actually defeats the purpose of using these feature

What I'm trying to do is have a <deny users="?"/>, but at the same time ALLOW access to anybody to non restricted pages, I was thinking that the way to do this will be having some kind of property set a the page level to specify that the page is not checking authentication or something like. This will give flexibility to mix pages that requires authentication and some others that not

Thank
----- Joseph E Shook [MVP - ADSI] wrote: ----

Search the help files for the <location> element

It lookes something like thi

<location path="Logon.aspx"><system.web><authorization><allo w users="?"/></authorization></system.web></location

Usually if you can organize your content in folders representing
different level of security and creating a web.config file for each of
these you are better off, but the Location element will give you the
ultimate flexibiltiy and even more chances to forget to secure something :

MR. UNDERHILL wrote
I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated user and some others, like the home page is not required. I specified the <deny users="?" /> on the web.config, but this is causing ALL pages require the authentication. How can I mix both, without loosing the web.config setup? I know that I can manually check the IsAuthenticated property on pages I want to enforce security, but I have an idea that there is some kind of Page property to specify that is secure, maybe I just dream it
Thank


Nov 18 '05 #3
If you read this you will start to see the ways one can place multiple
web.config files in a single web application. It forms a inheritance
and override behavior. Here is the link...

http://msdn.microsoft.com/library/de...figuration.asp
MR. UNDERHILL wrote:
When you said that you can "organize your content in folders representing different level of security", do you mean, multiple web applications (virtual directories)? or folders withing the same web application?. I understand that you can have only ONE web.config located at the ROOT of your web application (virtual directory). Could explain me a little bit more your approach.

Having the <allow users="?"/> is going to allow ALL unauthenticated users to get access to ALL pages, which actually defeats the purpose of using these feature!

What I'm trying to do is have a <deny users="?"/>, but at the same time ALLOW access to anybody to non restricted pages, I was thinking that the way to do this will be having some kind of property set a the page level to specify that the page is not checking authentication or something like. This will give flexibility to mix pages that requires authentication and some others that not.

Thanks


----- Joseph E Shook [MVP - ADSI] wrote: -----

Search the help files for the <location> element.

It lookes something like this

<location path="Logon.aspx"><system.web><authorization><allo w users="?"/></authorization></system.web></location>

Usually if you can organize your content in folders representing
different level of security and creating a web.config file for each of
these you are better off, but the Location element will give you the
ultimate flexibiltiy and even more chances to forget to secure something :)

MR. UNDERHILL wrote:
> I want to use forms authentication on my website. Looking at the documentation, I create a sample site for testing. One of my requirements is to ensure that SOME pages required an authenticated user and some others, like the home page is not required. I specified the <deny users="?" /> on the web.config, but this is causing ALL pages require the authentication. How can I mix both, without loosing the web.config setup? I know that I can manually check the IsAuthenticated property on pages I want to enforce security, but I have an idea that there is some kind of Page property to specify that is secure, maybe I just dream it!
>>> Thanks

Nov 18 '05 #4
That's really great. Thanks for your help!
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Billy Jacobs | last post by:
I have a website which has both secure and non-secure pages. I want to uses forms authentication. How do I accomplish this? Originally I had my web.config file in the root with Forms...
0
by: Stephen Bartholomew | last post by:
Hi All, I have an ecommerce site that resides mainly on an unsecure server for browsing the catalogue and only passes the user to a secure area when its time checkout. The secure domain however...
4
by: Leszek | last post by:
Hello, Is there anywhere on the net a simple step-by-step guide how to implement SSL with ASP.NET? My Internet provider enables this feature and I would like to use it to authenticate users on...
2
by: Shimon Sim | last post by:
I am creating application that is mostly is used by registered user. I am using Form security to let user in. I also need to create registration for users. This of cause has to be accessible to...
1
by: Iulian Ionescu | last post by:
I have a page (http://www.something.com/) and a secure page (https://secure.something.com) and the secure.something.com points to http://www.something.com/secure/ All works ok, but, when I...
1
by: UJ | last post by:
I have pages that all run fine. When I put them on a server that is using SSL, I start getting the 'There are secure and unsecure items on this page' message. And it's happening for almost every...
4
by: Jeff | last post by:
Using ASP.NET 1.1 Suppose I put the following code in an aspx code-behind's Page_Load() event procedure... if ( ! VerifiedSomething()) { Server.Transfer("../NoDice.aspx"); Response.End(); }
3
by: tshad | last post by:
I have a problem with a page I am trying to secure. It has a flash object as well as a couple of 3rd party objects used for tracking use of the page. I keep getting a message saying that there are...
13
by: tesis | last post by:
Hi all gurus; forgive me if I'm writing about a basic question. I need to call a secured (SSL) page from a .aspx page. Calling an absolute URL rises an error (invalid path... Virtual path...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.