473,511 Members | 16,068 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Question about redirecting a user after authentication

Hi,

This is a very typical requirement so I'm sure the answer is very
straightforward.

If a user tries to get to a secure directory, they can be a sent to a login
page automatically. Once the user has been authenticated, a call to,
FormsAuthentication.RedirectFromLoginPage()
will send the user to the page he had been originally trying to reach.

Good. Thats very handy and something I definately want to use. The problem
is, what do I do when the user navigates directly to the login page of
his/her own accord. In this case,
when the user is authenticated, I might want to just send them to a default
page.

My question is, how do I detect whether or not I should use
RedirectFromLoginPage() or another method that just redirects the user to a
page of my choosing.

I hope that makes sense! Thank you to anyone who can help me with this

Simon
Nov 18 '05 #1
2 995
Hi,

RedirectFromLoginPage() works just fine. If you redirect to login
page manually, make sure that a querystring "ReturnURL" is appended to
URL with value of ApplicationPath + "/" + "yourpage.aspx", and this value
is server encoded. Once login is validated it will automatically redirect
user
to page in that querystring. If returnURL is absent then
RedirectFromLoginPage
redirects to "default.aspx" in base directory.

Hope this helps,

FLU.

"Simon Harvey" <si**********@the-web-works.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
Hi,

This is a very typical requirement so I'm sure the answer is very
straightforward.

If a user tries to get to a secure directory, they can be a sent to a login page automatically. Once the user has been authenticated, a call to,
FormsAuthentication.RedirectFromLoginPage()
will send the user to the page he had been originally trying to reach.

Good. Thats very handy and something I definately want to use. The problem
is, what do I do when the user navigates directly to the login page of
his/her own accord. In this case,
when the user is authenticated, I might want to just send them to a default page.

My question is, how do I detect whether or not I should use
RedirectFromLoginPage() or another method that just redirects the user to a page of my choosing.

I hope that makes sense! Thank you to anyone who can help me with this

Simon

Nov 18 '05 #2

"Fluker" <fl*@youidiot.org> wrote in message
news:ed**************@TK2MSFTNGP10.phx.gbl...
Hi,

RedirectFromLoginPage() works just fine. If you redirect to login
page manually, make sure that a querystring "ReturnURL" is appended to
URL with value of ApplicationPath + "/" + "yourpage.aspx", and this value
is server encoded. Once login is validated it will automatically redirect
user
to page in that querystring. If returnURL is absent then
RedirectFromLoginPage
redirects to "default.aspx" in base directory.

Hope this helps,

FLU.

Hi Mr Flu,

Thanks for your help. It was that last line in your reply that I was
needing!

Thanks
Simon
Nov 18 '05 #3

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

Similar topics

1
7637
by: Stu | last post by:
Hi All, I have an ASP.NET application to which I have implemented forms authentication to handle security. It is a relatively straight forward solution with all aspx pages residing in the root...
2
3106
by: Robert Oschler | last post by:
I am working on a PHP 4 app that interacts with an external authorization server. The external server does "third-party" authorization of users. So I do the following: 1) Each of my PHP scripts...
5
1147
by: darrel | last post by:
I'm trying to set up a usercontrol that I can put on specific pages to authenticate people via their network login on our intranet. I have this in the config file: <authentication mode="Windows"...
4
3429
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...
1
3750
by: Jeremy Chapman | last post by:
I have built a web app. While testing I have found that if I browse to a page in the app, then get redirected to the login page and enter my credentials. The...
2
1979
by: Gary Coutts | last post by:
Hi, I am have problems redirecting from a login page. The login page is simple, with just 2 textboxes and one button. On the button click the routine below is called: I am using: Visual...
0
1084
by: chris fellows | last post by:
I have a generic authentication web page Authentication.aspx that is used by other web pages to authenticate the user if their application session has expired after N minutes since they last logged...
1
2252
by: Jeremy | last post by:
I have a web app that contains forms authentication to protect subdirectory called "admin" by denying anonymous users. When I request a protected resource in the admin directory I am presented with...
0
1149
by: Anup Daware | last post by:
Hi All, I am facing this very weird issue, for every server request my control is redirecting to the login page and again coming back to the actual page from where the request was initiated when I...
0
7242
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
7353
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,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
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...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.