Form Authentication and page problems with wcsf

Topics: User Forum
Feb 19, 2007 at 1:21 AM
Hi,

I am writing a web application using wcsf. I added this snippet in my web.config file and I am noticing strange behaviors

<authentication mode="Forms">
<forms loginUrl="Login.aspx" name=".ASPXFORMSAUTH" path="/"/>
</authentication>

<authorization>
<deny users="?"/>
</authorization>

What happens is this -
a) User is redirected to login.aspx page
b) Login.aspx page looses all its CSS => no formatting. Contents are intact though.
c) Displays javascript errors and I guessing it is because of some path problem on redirect

I even created a very simple application and the behavior is same.

Would really appreciate your help.

Regards & thanks
Kapil


Feb 19, 2007 at 8:43 AM
My guess is that you will see this issue even if you're not using the Web Client Factory - i.e. if you're using vanilla ASP.NET 2.0.

It is usually because your users do not have permission to your images/themes/javascript directories. Remember that the <deny users="?" /> line prevents anon users from accessing any of your site.

To allow anon users access to your themes and javascript (assuming this has no knock-on security implications in your particular application) you can put another web.config file in the "App_Themes" directory and others, containing the following;

<?xml version="1.0"?>
<configuration>
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</configuration>

(excuse the formatting... I suspect the indentation will be lost)

Hope that helps.

Simon
http://www.dotnetblogs.co.uk/
Feb 20, 2007 at 3:27 PM
Thanks Simon. Your suggestions worked.

Regards
Kapil