473,385 Members | 1,661 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Weird web.config issue

CW
I have run into a really strange problem.

My objective is that I only want user who have authenticated themselves to
be able to access the website (and authentication is performed by form
authentication). Only a registration web page is allowed anonymous access.

I have the following contents in web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- application specific settings -->
<appSettings>
<add key="ConnectionString"
value="server=localhost;Trusted_Connection=true;da tabase=Commerce" />
</appSettings>
<!-- forms based authentication -->
<system.web>
<compilation debug="true" />
<pages validateRequest="true" />
<!-- enable Forms authentication -->
<authentication mode="Forms">
<forms name="CommerceAuth" loginUrl="login.aspx"
protection="All" path="/" />
</authentication>
<authorization><deny users="?" /></authorization>
<!-- enable custom errors for the application -->
<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx" />
<!-- disable session state for application -->
<sessionState mode="Off" />
<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8"/>
</system.web>
<!-- set non-secure paths -->
<location path="Register.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
</configuration>

With this web.config, I have run into a really stange problem. If I access
the website from IIS machine that hosts this application, I get to the
login.aspx as expected. After supplying the correct credential, the
application takes one to the default.aspx as configured.

However, if I access the web application from a remote computer, despite
that having supplied correct credentials, login.aspx keeps redirecting to
itself rather than default.aspx. I checked that login.aspx has executed
FormsAuthentication.RedirectFromLoginPage(loginId, false) method correctly
(i.e., login is successful) using VS debugger.

Any idea what is happening here?

Thanks in advance
CW

Nov 18 '05 #1
2 2060
CW
I found a way to get around this weird problem.

On the remote computer, instead of specifying the computer name, if I use
the IP address, everthing would work.

i.e., to access the website on a remote computer, if I use
http://xxxx.xxxx.xxxx.xxxx/commerce, everything works fine. After logging
in, the user gets redirected to the default.aspx.

However, if I use http://computername/commerce, login.aspx keeps redirecting
to itself.

Both the remote and iis computer is sitting on the same LAN (and both
computers are running win xp).

This is even more bizzare than I think. Any idea as to why such strange
behaviour?
"CW" <a> wrote in message news:#s**************@tk2msftngp13.phx.gbl...
I have run into a really strange problem.

My objective is that I only want user who have authenticated themselves to
be able to access the website (and authentication is performed by form
authentication). Only a registration web page is allowed anonymous access.

I have the following contents in web.config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!-- application specific settings -->
<appSettings>
<add key="ConnectionString"
value="server=localhost;Trusted_Connection=true;da tabase=Commerce" />
</appSettings>
<!-- forms based authentication -->
<system.web>
<compilation debug="true" />
<pages validateRequest="true" />
<!-- enable Forms authentication -->
<authentication mode="Forms">
<forms name="CommerceAuth" loginUrl="login.aspx"
protection="All" path="/" />
</authentication>
<authorization><deny users="?" /></authorization>
<!-- enable custom errors for the application -->
<customErrors mode="RemoteOnly" defaultRedirect="ErrorPage.aspx" /> <!-- disable session state for application -->
<sessionState mode="Off" />
<globalization fileEncoding="utf-8" requestEncoding="utf-8"
responseEncoding="utf-8"/>
</system.web>
<!-- set non-secure paths -->
<location path="Register.aspx">
<system.web>
<authorization>
<allow users="?" />
</authorization>
</system.web>
</location>
</configuration>

With this web.config, I have run into a really stange problem. If I access
the website from IIS machine that hosts this application, I get to the
login.aspx as expected. After supplying the correct credential, the
application takes one to the default.aspx as configured.

However, if I access the web application from a remote computer, despite
that having supplied correct credentials, login.aspx keeps redirecting to
itself rather than default.aspx. I checked that login.aspx has executed
FormsAuthentication.RedirectFromLoginPage(loginId, false) method correctly
(i.e., login is successful) using VS debugger.

Any idea what is happening here?

Thanks in advance
CW

Nov 18 '05 #2
CW
Thanks for the reply. But it didn't make an iota of difference if I use
computername in the url.

"Bin Song" <an*******@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
try changing the authorization block to the following:
<authorization><deny users ="?" /><allow users ="*" /></authorization>

Bin Song, MCP
----- CW wrote: -----

I have run into a really strange problem.

My objective is that I only want user who have authenticated themselves to be able to access the website (and authentication is performed by form authentication). Only a registration web page is allowed anonymous access.
I have the following contents in web.config:

<?xml version="1.0" encoding="utf-8" ?><configuration><!-- application specific settings --><appSettings><add key="ConnectionString" value="server=localhost;Trusted_Connection=true;da tabase=Commerce" /></appSettings><!-- forms based authentication --><system.web><compilation
debug="true" /><pages validateRequest="true" /><!-- enable Forms
authentication --><authentication mode="Forms"><forms name="CommerceAuth"
loginUrl="login.aspx" protection="All" path="/" /></authentication><authorization><deny users="?" /></authorization><!-- enable custom errors for the
application --><customErrors mode="RemoteOnly"
defaultRedirect="ErrorPage.aspx" /><!-- disable session state for
application --><sessionState mode="Off" /><globalization
fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/></system.web><!-- set non-secure paths --><location path="Register.aspx"><system.web><authorization><a llow
users="?" /></authorization></system.web></location></configuration>
With this web.config, I have run into a really stange problem. If I access the website from IIS machine that hosts this application, I get to the login.aspx as expected. After supplying the correct credential, the
application takes one to the default.aspx as configured.

However, if I access the web application from a remote computer, despite that having supplied correct credentials, login.aspx keeps redirecting to itself rather than default.aspx. I checked that login.aspx has executed FormsAuthentication.RedirectFromLoginPage(loginId, false) method correctly (i.e., login is successful) using VS debugger.

Any idea what is happening here?

Thanks in advance
CW

Nov 18 '05 #3

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

Similar topics

13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
1
by: George Addison | last post by:
Any idea why I am able to query an Access database OK, but when I try to read field info from records that I know are there I get an error that indicates: "No data exists for the row/column"? ...
8
by: CW | last post by:
I have run into a really strange problem. My objective is that I only want user who have authenticated themselves to be able to access the website (and authentication is performed by form...
1
by: Robert | last post by:
I have a server where the main web application (root) is now migrated to 2.0. It's web.config has a line where it adds the system.data.oracleclient in the configuration and assembiles section. ...
17
by: Fred Nelson | last post by:
Hi: I have written several web applications that obtain their connection strings from the web.config file. This is very easy to use and it makes it easy to move an app from development into...
5
by: David Thielen | last post by:
Hi; Ok, I will be the first to agree that this should be impossible - except we are able to keep repeating it. Our login page - which has moderately complex html and uses <LayoutTemplate> to...
10
by: =?Utf-8?B?U3RlZmFuIEJhcmxvdw==?= | last post by:
This has been working perfectly for months. Since we switched from ASP.NET 1.1 to 2.0, we have constant and sporadic issues with updating our applications. Touching the web.config works about...
3
by: SevDer | last post by:
Hi All, I am recently experiencing a weird problem. I don't know what exactly is the cause of the problem but here is my scenario and symptoms. First of all here is my architecture 1. I have...
6
by: jsamdirect | last post by:
I am having a weird issue with php preg_match. I am moving to my php sites to a new server. On the old server all works well. On the new server preg_match always returns false. If I log in via ssh...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
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 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.