473,792 Members | 2,937 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

cassini, forms authentication and application folder [2.0]

Hi,

I struggle for over an hour with the integrated Cassini web server. the
problem I am facing is as follows:

when I turn forms authentication on in the web.config file, the website
seems to be running in the context of a wrong directory. images, style
sheets and jscripts files placed in app directory (or in subdirectories)
suddenly become invisible to the application. when I move the application to
the IIS, it works as expected but I like the light-weight of Cassini and
still wish to use it for development.

steps to reproduce behavior:

1. create new web application to be run under cassini
2. add two forms, default.aspx and login.aspx
3. on both forms add an image container:
<img src="testimage. jpg" />

where testimage.jpg resides in the application root folder.

3. set the authentication to "Windows"

4. on default.aspx add a Button and place

Response.Redire ct( "login.aspx " );

you will see that the image is correctly visible on both forms even if a
redirect takes place.

5. change the authentication to "Forms" with

<authenticati on mode="Windows">

<forms loginUrl="login .aspx" name="AuthCooki e" timeout="60" path="/"
protection="All " />

</authentication >

6. run the application. after the Forms Authentication redirects you to the
login page, you will see that the image container in login.aspx is empty.

even if you manually disable redirect for the default.aspx:

<location path="Default.a spx">
<system.web>
<authorizatio n>
<allow users="?"/>
</authorization>
</system.web>
</location>
the image is still invisible.

is there a simple and clever way to overcome this issue?

thanks in advance,

Wiktor
Nov 21 '05 #1
2 1744
Wiktor,

You were on the right track in attempting to grant all users access to the
root structure, but access is granted from the top down. In other words you
need to allow all first and then limit pages afterward. The first item in
the security settings overrides all others.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Wiktor Zychla [C# MVP]" <wz*****@nospm. ii.uni.wroc.pl. nospm> wrote in
message news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi,

I struggle for over an hour with the integrated Cassini web server. the
problem I am facing is as follows:

when I turn forms authentication on in the web.config file, the website
seems to be running in the context of a wrong directory. images, style
sheets and jscripts files placed in app directory (or in subdirectories)
suddenly become invisible to the application. when I move the application
to the IIS, it works as expected but I like the light-weight of Cassini
and still wish to use it for development.

steps to reproduce behavior:

1. create new web application to be run under cassini
2. add two forms, default.aspx and login.aspx
3. on both forms add an image container:
<img src="testimage. jpg" />

where testimage.jpg resides in the application root folder.

3. set the authentication to "Windows"

4. on default.aspx add a Button and place

Response.Redire ct( "login.aspx " );

you will see that the image is correctly visible on both forms even if
a redirect takes place.

5. change the authentication to "Forms" with

<authenticati on mode="Windows">

<forms loginUrl="login .aspx" name="AuthCooki e" timeout="60"
path="/" protection="All " />

</authentication >

6. run the application. after the Forms Authentication redirects you to
the login page, you will see that the image container in login.aspx is
empty.

even if you manually disable redirect for the default.aspx:

<location path="Default.a spx">
<system.web>
<authorizatio n>
<allow users="?"/>
</authorization>
</system.web>
</location>
the image is still invisible.

is there a simple and clever way to overcome this issue?

thanks in advance,

Wiktor

Nov 21 '05 #2
> You were on the right track in attempting to grant all users access to the
root structure, but access is granted from the top down. In other words
you need to allow all first and then limit pages afterward. The first item
in the security settings overrides all others.


that's it. thanks a lot.

I thinks that for security reasons I will rather do in in an oposite way:
deny all first but configure selected items for unrestricted access. anyway,
this works now. thanks again.

Regards,
Wiktor
Nov 21 '05 #3

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

Similar topics

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
2
1730
by: Senthil | last post by:
1. Created a new C# web application project 2. Change the name of webform1 to login.aspx 3. And in the .cs file change the name of the class to login, and include System.web.security namespace. 4. Place a textbox and a button in the login.aspx form. 5. Have the following code in the button click event. if (true) { FormsAuthentication.RedirectFromLoginPage(TextBox1.Text, false)
3
4872
by: Kris van der Mast | last post by:
Hi, I've created a little site for my sports club. In the root folder there are pages that are viewable by every anonymous user but at a certain subfolder my administration pages should be protected by forms authentication. When I create forms authentication at root level it works but when I move my code up to the subfolder I get this error: Server Error in '/TestProjects/FormsAuthenticationTestingArea' Application.
12
1625
by: Brett Robichaud | last post by:
Is anyone familiar with this error? I have this running just fine on my local machine but when I pushed it out to our development server I get this error. I have no idea what it is saying. Any clues? -Brett- Server Error in '/' Application. ---------------------------------------------------------------------------- ----
2
1426
by: Thomas Scheiderich | last post by:
I am trying to set up forms authentication in my IIS pages. I have a folder inside of my root folder I am trying to protect and I am getting an error when a page in the folder is accessed. The error is: **************************************************************************** **** Server Error in '/' Application. ----------------------------------------------------------------------------
1
1627
by: Sumaira Ahmad | last post by:
Hi, Please help me with this.. I am trying to use Forms Authentication in a sample project. I basically want to have two folders in my application , one in which I store pages that can be accesed without authentication and one which can be accessed only by authenticated users.. In my Anonymous folder: there is a default.aspx - which is a start up page
2
1420
by: Grzegorz Kaczor | last post by:
Hello, I have an ASP.NET application in my website in virtual folder A. This folder contains the application itself. I also have a data virtual directory B which contains data that can be seen by authenticated users. I've implemented forms authentication (with application in folder A) in a standard way. I've also set up a redirection in IIS so that every request concerning folder B (for example GET /B/a/b/c) is redirected to...
4
1771
by: David | last post by:
Hi all, I have a problem with Forms Auth. I am not using the protected folder method, rather, I want some parts of the page to be shown depending on the authentication state. Basically, I have a dashboard application. In the dashboard, I have various hyperlinks and linkbuttons. I have also created roles and each user will be assigned a role and the buttons in the dashboard will depend on the role. If the person is not authenticated,...
4
2946
by: yancheng.cheok | last post by:
Hello all, I have a web application, which I had developed few years ago with ASP .NET 1.1 Today, I would like to deploy the web application to client, using ASP .NET 2.0 + UltiDev Cassini 2.0 I locate my whole project in a folder named C:\website\GOWatch
0
9670
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
9518
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
9033
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
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...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5436
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5560
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4111
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
3719
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.