Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Question about redirecting a user after authentication

Reply
Thread Tools

Question about redirecting a user after authentication

 
 
Simon Harvey
Guest
Posts: n/a
 
      02-18-2004
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


 
Reply With Quote
 
 
 
 
Fluker
Guest
Posts: n/a
 
      02-18-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Simon Harvey
Guest
Posts: n/a
 
      02-18-2004

"Fluker" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0 Forms Authentication - not always redirecting toLogin.aspx after session timeout alovhaug@gmail.com ASP .Net Security 0 05-16-2008 05:40 PM
Forms Authentication not Redirecting Jeremy ASP .Net 1 10-21-2007 10:14 AM
Redirecting via windowd authentication darrel ASP .Net 5 12-11-2004 11:11 AM
Forms Authentication - Not timing out, not redirecting. AVance ASP .Net 1 07-28-2004 08:23 PM
not redirecting to login page while using forms authentication Pradeep Pise ASP .Net 0 07-09-2004 07:27 AM



Advertisments