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.Redirect( "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
<authentication mode="Windows">
<forms loginUrl="login.aspx" name="AuthCookie" 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.aspx">
<system.web>
<authorization>
<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 2 1721
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****************@TK2MSFTNGP12.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.Redirect( "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
<authentication mode="Windows">
<forms loginUrl="login.aspx" name="AuthCookie" 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.aspx"> <system.web> <authorization> <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
> 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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....
|
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...
|
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...
|
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...
|
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...
|
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: 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...
|
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...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |