Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

authentication/web.config troubles

Status
Not open for further replies.

motte

Programmer
May 31, 2001
155
US
Hi all,

I am having troubles with web.config issues.
here is my web.config
Code:
<?xml version=&quot;1.0&quot; ?>
 

<!-- Web.Config Configuration File -->

<configuration>
<system.web>
	<authentication mode=&quot;Forms&quot;>
	<forms name=&quot;.ASPXAUTH&quot; path=&quot;/students/schu7392/project/aitp/&quot; loginurl=&quot;login.aspx&quot; protection=&quot;All&quot;  timeout=&quot;30&quot;>
		<credentials passwordformat=&quot;Clear&quot;>
			<user name=&quot;Mike&quot; password=&quot;otter1&quot; />
			<user name=&quot;Jeannette&quot; password=&quot;chappi1&quot; />
		</credentials>
	</forms>
	</authentication>

	<authorization>
	<allow users=&quot;Mike, Jeannette&quot; />
	<deny users=&quot;*&quot; />
	</authorization>
</system.web>
</configuration>

In &quot;/students/schu7392/project/aitp/&quot; is where that web.config is, along with login.aspx. But I get this error when I try to access login.aspx.
Code:
Parser Error Message: 'Authentication' section cannot be defined for directories below the application root.

Line 6:  <configuration>
Line 7:  <system.web>
Line 8:  	<authentication mode=&quot;Forms&quot;>
Line 9:  	<forms name=&quot;.ASPXAUTH&quot; path=&quot;/students/schu7392/project/aitp/&quot; loginurl=&quot;login.aspx&quot; protection=&quot;All&quot;  timeout=&quot;30&quot;>
Line 10: 		<credentials passwordformat=&quot;Clear&quot;>

I thought I could have a web.config file in the same directory as other files. Is this not the case? This is a server for school so I don't know what is happening higher up, but shouldn't this web.config file work for what is in its directory?

Any help would be appreciated. This is done with notepad, so no vs.net stuff would really apply to me.

Mike
 
Hi Mike,

I'm not positive on this but it sounds to me like you are having trouble because the &quot;/students/schu7392/project/aitp/&quot; directory is not defined as a virtual directory and therefore is not your application root. That would explain the Parser error.

Keep in mind that you do not need to have the authentication section and the authorization section in the same web.config so you may need to shift the authentication section to the web config in the application root.
hope this helps some.

hads.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top