Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 261
  • Last Modified:

How to implement froms authentication to one subfolder in your application

Hi,

I have a subfolder which I have named 'secure' which I need to implemnt forms authentication to. Can someone please advise on the correct method of restricting a subfolder using forms authentication.
0
jazz__man
Asked:
jazz__man
  • 2
2 Solutions
 
aianrnoensCommented:
System wide configuration settings are put in the machine.config file.
These settings can be overridden by placing a web.config file in the root directory of a website.
to override the root web.config place a web.config in the subfolder.

just place a web.config file in the secure sub folder with the following in it.
<configuration>
  <system.web>
    <authentication mode="forms"></authentication>
  </system.web>
</configuration>

Open in new window

0
 
aianrnoensCommented:
These are websites for research.

On forms authentication.
http://msdn.microsoft.com/en-us/library/xdt4thhy%28v=vs.71%29.aspx

On multiple web.config files.
http://www.codeproject.com/KB/aspnet/multipleWebConfig.aspx
0
 
jazz__manAuthor Commented:
I get the following error when I create the web.config in 'secure' folder....

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.


When I create a website in IIS out of the 'secure' folder i then get the following error ...

The file '/eCommerceUIFront/Secure/Masterpages/EcommerceFront.Master' does not exist.

0
 
asp_net2Commented:
Hi jazz_man,

Please upload your code and web.config files for viewing.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now