Ask a Question related to ASP.NET Security, Design and Development.
-
Paul K #1
Forms authentication not working???
I'm having a problem getting forms authentication to work.
I have two web config files. The first one (located in
the application directory) is defined as follows:
<configuration>
<system.web>
<authentication mode="Forms">
<forms loginUrl="default.aspx"/>
</authentication>
</system.web>
</configuration>
The second one (located in a subdirectory
named "private") is defined as follows:
<configuration>
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</configuration>
My authentication code follows:
if (!mBLL.AuthenticateUser(txtUID.Text, txtPassword.Text,
ref dt))
{
lblError.Text = "The provided credentials could
not be authenticated. Please try again.";
}
else
{
Session.Contents.Add("UID",(object)txtUID.Text);
Session.Contents.Add("EName",(object)(dt.Rows[0]
["FName"].ToString() + " " + dt.Rows[0]["LName"].ToString
()));
Session.Contents.Add("EKey",dt.Rows[0]
["EmployeeKey"]);
Session.Contents.Add("IsAdmin",dt.Rows[0]
["IsAdmin"]);
Session.Contents.Add("WeekEnding",null);
Session.Contents.Add("SelDate",null);
url = FormsAuthentication.GetRedirectUrl
(txtUID.Text,true);
if (url == "/EPES/default.aspx")
url = "private/production.aspx?MOVEWEEK=NONE";
Response.Redirect(url);
Whenever I try to access production.aspx directly, I am
not redirected to default.aspx.
If I test the result of the User.Identity.IsAuthenticated
property on production.aspx, it is true (even without
being authenticated).
Any help would be greatly appreciated!
Paul K
Paul K Guest
-
Accessing htm files without authentication (forms authentication)
I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But... -
ASP.Net Forms authentication with basic authentication popup
Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user... -
Forms authentication then redirection to a secure web with NT authentication?
Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've... -
Authentication ticket, cookieless, forms authentication?
Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the... -
Forms authentication with Windows authentication
Hi, I have an ASP.NET web site that uses IIS Basic Authentication and accesses an OLAP Server at various stages. The OLAP Server authentication... -



Reply With Quote

