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

RedirectFromLoginPage and loop

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 login+password.
Thus I changed the security parameters in IIS (anonymous user unchecked,
Windows authentication checked). But I let the Forms in web.config unchanged
because I wanna keep the ReturnUrl system because I have some Session
parameters that are set at the beginning, no matter which page you use to get
in.

So, instead of checking the login;password couple is right, I just check
whether the Login Windows is valid, and then I run a RedirectFromLoginPage.
The trouble is that the page loops constantly. The RedirectFromLoginPage is
not taken into consideration whereas a debug shows it's ran. So, what's wrong?

Scheme:

My index.aspx:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
If Session("UserLoginIntegrated") Is Nothing Then
IntegratedConnection()
End If
End Sub

Private Sub IntegratedConnection()
Dim booUserExists As Boolean
Dim dtNew As DataTable
Dim booGo As Boolean = False
Dim returnUrl As String
Try

'Code to check whether current user is valid
' If not then display login page
' Else

Session("UserLoginIntegrated") = False
FormsAuthentication.RedirectFromLoginPage(Session. SessionID,
False)

End If
Catch ex As Exception
ErrorLogin.Text = (ex.Message)
ErrorLogin.Visible = True
Session("UserLoginIntegree") = False
Session.Clear()
Session.Abandon()
System.Web.Security.FormsAuthentication.SignOut()
End Try

End Sub

With such a code portion, the page loops moebiusly and never goes to the
requested page.

Thanks in advance,

Rob

Nov 22 '05 #1
0 937

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

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...
2
by: Gan | last post by:
Hi, I just wonder after calling the RedirectFromLoginPage function, my current page still stick to login.aspx fiile. Any clue?? Thanks
1
by: Murphy | last post by:
I am trying to code a workaround to avoid being redirected to default.aspx if the ReturnURL parameter is blank when the RedirectFromLoginPage method is called. Depending upon the login status the...
2
by: Ben Fidge | last post by:
Is FormsAuthentication.RedirectFromLoginPage the only way to populate the HttpContext.Current.User.Identity.Name property? A base class for each page contains the follwoing property: public...
2
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...
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: Andy Sutorius | last post by:
Hi, For some reason the login.aspx webpage redirects to itself after a successful login and not to the url in the address bar. I have stepped through this with debug and it behaves as it is...
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" />...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.