Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Security / June 2005

Tip: Looking for answers? Try searching our database.

ASP.NET Authuntication & Authorization

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ADITYA CHS - 12 Jun 2005 15:23 GMT
Hi,
Please help me. I would like to know how to add more than one web.config
file to an ASP.NET APPLICATION/PROJECT

I want this 'coz in my web site some pages need no authuntication and
authorization.anonymous users are allowed access some pages.but they are
restricted to view some pages which need to proper authuntication and
authorization

I read that i need to add all secured pages into one sub dir and add another
web.config in that folder.  But it is giving error.wat i did is :  
in main web.config.
<authentication mode="Forms" />
<authorization>
<allow users="*" />
</authorization>

in the seconf web.config(created in a subfolder)
<authentication mode="Froms" />
<authorization>
<allow users="csa" />
<deny users="?" />
</authorization>

but its giving following error  

Server Error in '/satya' Application.
-------------------------------------

Configuration Error
Description: An error occurred during the processing of a configuration file
required to service this request. Please review the specific error details
below and modify your configuration file appropriately.

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level. This error
can be caused by a virtual directory not being configured as an application
in IIS.

Source Error:

Line 37: by Microsoft that offers a single logon and core profile services
for member sites.
Line 38: -->
Line 39: <authentication mode="Froms" />
Line 40:
Line 41:

Source File: c:\inetpub\wwwroot\satya\sec\web.config Line: 39
__________________
With Thanks
Aditya Ch S  
Mark A. Richman - 12 Jun 2005 19:54 GMT
You need to make that subdirectory an AppRoot for that second web.config to
work. That is why you get the "virtual directory not being configured as an
application" error.

Signature

MARK RICHMAN

> Hi,
> Please help me. I would like to know how to add more than one web.config
[quoted text clipped - 52 lines]
> With Thanks
> Aditya Ch S
ADITYA CHS - 29 Jun 2005 13:50 GMT
I didnt understand the thing AppRoot.I am a new bee in .NET and in learing
stage.Any way by searching in web I got a solution which solved my probelm.

The solution is  :

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.web>
<authorization>
          <allow users="Satya"/>  
          <deny users="*" />
</authorization>
</system.web>
</configuration>

The thing is we should remove every thing from inner Web.Config except the
above code.What I did is using VS IDE i added a web.config file ,in which
there will be built in code given by IDE ,i simply edited the code and added
my code.Which is the reason for error.Now after removing  all unnesasary code
I got the solution.

> You need to make that subdirectory an AppRoot for that second web.config to
> work. That is why you get the "virtual directory not being configured as an
> application" error.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.