473,796 Members | 2,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Secure some pages and not other

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 everyone.
Can I do everything in one ASP.NET application or I have to create two
applications for each task?
Thanks,
Shimon.
Nov 18 '05 #1
2 1392
Put all secured page in one directory and use a seperate web.config in that
direcotry to specify <authorization> <deny ...>

"Shimon Sim" <es*****@att.ne t> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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 everyone.
Can I do everything in one ASP.NET application or I have to create two
applications for each task?
Thanks,
Shimon.

Nov 18 '05 #2
Hi Shimon,

Thanks for posting in the community!
From your description, you're using the Formsauthentica tion in your ASP.NET
web app. And you've some different sets fo files in your web apps which are
protected from different groups of users(protected level). So you're
wanting how to set such multi-authroized configuration in a single ASP.NET
web app, yes?
If there is anything I misunderstood, please feel free to let me know.

Based on my experience, you may have a try on the <location> Element in the
web.config file. This element can help apply a certain sections of
configuration to a certain specified part of a web app(via url path). Here
are the referernce of the <location> Element in MSDN:

#<location> Element
http://msdn.microsoft.com/library/en...ationelement.a
sp?frame=true

As for your situation , you can put those different protected files into
several sub dirctories in the web app's root folder. Then use the
<location> Element to specify different authorization settings for these
sub directories. For example:
If we have a web app named MyApp(used formsauthentica tion) and has the
following folder hierarchy:
MyApp/
....public resources
Admin/
....admin protected level resources
User/
....normal user protected level resources

Then we can specify different authorization protections for them via t he
below configuration in web.config
<configuratio n>
<system.web>
<authenticati on mode="Forms">
<forms name=".ASPNET_F ORM_NAME" loginUrl="login .aspx" >
</forms>
</authentication>

<authorizatio n>
<allow users="*" />
</authorization>
</system.web>

<!¡ª Configuration for the "Sub1" subdirectory. -->
<location path="Admin">
<system.web>
<authorizatio n>
..... Authrozation for Admin
</authorization>
</system.web>
</location>

<!¡ª Configuration for the "Sub2" subdirectory. -->
<location path="sub2">
<system.web>
<authorizatio n>
..... Authrozation for Normal user

</authorization>
</system.web>
</location>
</configuration>

In addition, here are some further tech references on how to apply
heirarchical configuration Inheritance in web.config:

#Configuration Inheritance
http://msdn.microsoft.com/library/en...igurationinher
itance.asp?fram e=true

#Configuration <location> Settings
http://msdn.microsoft.com/library/en...igurationlocat
ionsettings.asp ?frame=true

#Locking Configuration Settings
http://msdn.microsoft.com/library/en...ingconfigurati
onsettings.asp? frame=true

Please refer to them if you feel anything unclear.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #3

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

Similar topics

6
3137
by: Sarah Tanembaum | last post by:
I was wondering if it is possible to create a secure database system using RDBMS(MySQL, Oracle, SQL*Server, PostgreSQL etc) and web scripting/programming language(Perl, PHP, Ruby, Java, ASP, etc) combination? I have the following in mind: I wanted to store all my( and my brothers and sisters) important document information such as birth certificate, SSN, passport number, travel documents, insurance(car, home, etc) document, and other...
6
4842
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 Authentication set up and it worked just fine. Then I realized that I needed to have some pages unsecure. I then created 2 directories. One named Secure and the other named Public. I placed my web.config file in my
3
14050
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to enter the absolute url like response.redirect("https://myProductionServer.com/SecurePage.aspx"), because when Im working in the development server I would have to change it back and forth everytime. Is there an easy way to do this without having...
1
1649
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 transfer to one of the pages on the secure directory all gets lost. First of all, I had to basically duplicate my web application assembly in the secure folder. I created a "secureWrapper" solution and I added the main web application as a reference,...
7
2285
by: VB Programmer | last post by:
I created an ASP.NET website and recently got a secure certificate. Whenever I visit any of the pages IE says "This page contains both secure and nonsecure items. Do you want to display the nonsecure items?" What is considered secure and nonsecure? As the developer how can I create the pages so this message doesn't appear? Thanks!
1
2624
by: Prabhu | last post by:
Hi. We have an ASP.net Web application in which some of the pages are to be served over secure channel using HTTPS. We have built a framework that allows pages to be served over secure channel specified in a configuration file. When a request for specified pages comes over HTTP, framework detects and redirects the browser over HTTPS. Similarly for non secure pages if the request comes over HTTPS the framework redirects the browser onto...
3
1436
by: Just D. | last post by:
All, I'm having a WebApp working through a secure connection (https). One of my pages is calling an external site to show the geographical map, this site is not secure and it should be calling inside the frame on the secure page. The browser (IE) complains that the page has secure and non-secure items. When we click Yes, it continues and works just fine. Do we have any method to tell the browser do not show this warning on this page...
5
2176
by: Joe | last post by:
I have an application which runs in a non-secure environment. I also have an application that runs in a secure environment (both on the same machine). Is there any way to share the session data for this? Most of the site allows the user to add things to a cart (non-secure), once they choose to check-out, I need this information which was stored in the session to be read by the payment page(secured). Hope this makes sense. It's probably...
14
4926
by: knal | last post by:
Hi there, I'm looking for a secure login script for a sort-of-community site... (PHP, MySQL, sessions, or maybe something else ... ) I know there are a lot of scripts out there, but none of them really seem secure, or have other kind of flaws (like IP based login etc.). Why i'm asking here, is because there's experience out there, and i hope experience can tell me what my best shot is. I'm aware that i will very probably have to do...
0
2347
by: amitvps | last post by:
Secure Socket Layer is very important and useful for any web application but it brings some problems too with itself. Handling navigation between secure and non-secure pages is one of the cumbersome jobs. When a non-secure page references a secure page with relative URL, the web server generates error until absolute URL with https prefix is used. On the other hand when a secure page references a non-secure page, the non-secure page will be...
0
9684
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9530
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10182
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7552
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.