473,386 Members | 1,654 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,386 software developers and data experts.

RedirectFromLoginPage problem

I developed a site with a reserved section based on roles, when I try to access that page i got redirected correctly to the loginpage and on the address bar i see
the ReturnUrl containig the address to point to:

http://localhost/SiteName/login.aspx?ReturnUrl=%2fSiteName%
2fadministrator%2fdefault.aspx

administrator/default.aspx is the page I have to reach
I authenticate succesfully but when the following instruction executes without error:
FormsAuthentication.RedirectFromLoginPage(user, chkRemember.Checked)
i still remain in the same page, only user and pwd disappear

the address in the bar is still the same....

otherwise if i submit incorrect user o pwd I got an error that indicates the redirect correctly fails:
If AuthenticateUser(userEncoded, pwdEncoded, roles) Then
FormsAuthentication.RedirectFromLoginPage("@" & ruoli, chkRemember.Checked)

Else
lblLogin.Text = "Access denied!"
End If


Any idea?

Thanks
Alessandro
Sep 21 '06 #1
2 5164
bargz
1
I had a similar problem and I finally found that in my web.config the forms authentication tag had requireSSL="true" which, it turns out, sets a property on the authorization cookie "Secure=true" which, it turns out, means if you're request is not over SSL (HTTPS) then the cookie will not be actually passed to the client! Change the web.config to requireSSL="false" and see if that fixes your problem.

-jp

I developed a site with a reserved section based on roles, when I try to access that page i got redirected correctly to the loginpage and on the address bar i see
the ReturnUrl containig the address to point to:

http://localhost/SiteName/login.aspx?ReturnUrl=%2fSiteName%
2fadministrator%2fdefault.aspx

administrator/default.aspx is the page I have to reach
I authenticate succesfully but when the following instruction executes without error:
FormsAuthentication.RedirectFromLoginPage(user, chkRemember.Checked)
i still remain in the same page, only user and pwd disappear

the address in the bar is still the same....

otherwise if i submit incorrect user o pwd I got an error that indicates the redirect correctly fails:
If AuthenticateUser(userEncoded, pwdEncoded, roles) Then
FormsAuthentication.RedirectFromLoginPage("@" & ruoli, chkRemember.Checked)

Else
lblLogin.Text = "Access denied!"
End If


Any idea?

Thanks
Alessandro
Oct 17 '06 #2
kombat
1
I authenticate succesfully but when the following instruction executes without error:
FormsAuthentication.RedirectFromLoginPage(user, chkRemember.Checked)
i still remain in the same page, only user and pwd disappear

the address in the bar is still the same....
I just spent several hours fighting with this same issue and finally discovered the problem. In my case, my "SignIn" page began life as "default.aspx" and had been renamed to SignIn.aspx. However, the "Inherits" property of the "@Page" directive at the top of the page still referred to "default", and the codebehind defined a partial class named "default" instead of SignIn. When I changed the "Inherits" property to match the name of the page ("Signin"), and changed the name of the class in the codebehind to match as well, it worked.

Hope this helps save someone the time I just wasted. :(
Nov 13 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Rob O'Cop | last post by:
Hi, I've got an Intranet site that's been using the usual Forms authentication. Now, I want to retrieve the Windows Login and authenticate the user automatically without her typing...
0
by: Andres Romero | last post by:
I have a login web form named login.aspx, wich validates user from a database. I configure the Web.config file to it authenticates using Form mode, and when the user try acces other page than...
3
by: Shawn | last post by:
Hi. I'm using RedirectFromLoginPage to redirect the user if the login was successful. The problem is that I don't want the user to be redirected to the page he requested. I want him to be...
2
by: tshad | last post by:
I have a logon page that is may be called by the Forms Authentication setup. This would put a ReturnURL as part of the URL. I would normally then just issue a: ...
8
by: Edward Mitchell | last post by:
I have a main project that is protected in that the user is directed to a login.aspx file. The text in the web.config file is: <authentication mode="Forms"> <forms loginUrl="Login.aspx" />...
4
by: jjjooooohhnnn | last post by:
Greetings, I have encountered what appears to be a fairly common problem: RedirectFromLoginPage is not redirecting to RedirectUrl. I have tried all the advice that I could on the 'net, and...
5
by: BoltonWolf | last post by:
Hi, I have a ASP.Net web site, that we sell as a module to our core software, versions of this site are running fine on many servers, however we are having problems with our latest installtion,...
9
by: Sandy | last post by:
Any help anyone can give me will be appreciated!!!! This is driving me c-r-a-z-y! All I can get from both of the above redirections is a redirect to a page named default.aspx. How do I make...
2
by: Matt | last post by:
I have found a scenario where I would like to cancel the RedirectFromLoginPage. If a user is authenticated in my web application then they manually enter a URL to a valid web page but do not have...
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:
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...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
Oralloy
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 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.