Re: FormsAuthentication and GetRedirectUrl



Hi Steven,

I sort of thought that would be the case so I did manually track the url for
redirection after the user logs in.

Thanks,
Joe

"Steven Cheng[MSFT]" <stcheng@xxxxxxxxxxxxxxxxxxxx> wrote in message
news:5W4dY5ebIHA.2164@xxxxxxxxxxxxxxxxxxxxxxxxx
Hi Joe,

As for the Forms Authentication url redirction problem you mentioned, I
understand what you want to do and the difficulty here is
FormsAuthentication will only append originalUrl in querystring when the
redirection is caused by Unauthorization. For the "create new account"
case, it is not redirected by unauthorization, but by the user who click
the link, then the ASP.NET will not provide such url.

Currently, my suggestion is to manually keep such a url in session. for
example, in the page where you provide the "Create User account" link, you
can add the following code logic:

** you should modify the link to the create account page, append the
original url to the querystring of this link's url

** in the create account page, you can get the original url from
querystring and store it into session

** After user finished creating account, you can check the session
variable, if there is url exists, redirect to the url (if not exists due
to
some reason, redirect the default location)

How do you think?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no
rights.
--------------------
From: "Joe" <jbassking@xxxxxxxxxxxxxxx>
Subject: FormsAuthentication and GetRedirectUrl
Date: Tue, 12 Feb 2008 12:40:33 -0500


Hello,

I'm using FormsAuthentication for a single page. If the user tries to go
direct to the page they are prompted to login. This all works fine. But if
the user doesn't have a user account and clicks the Create user account
link
the GetRedirectUrl no longer has the original page they were going to.
Instead it has the default from the web.config.

Is there any way to preserve the original URL past the login page?

Ideally if the user clicks to create account, I want to transfer them to
the
page to create it. Once done I want to direct them to their original page
which will prompt them to login.

I hope this makes sense.

Thanks,
Joe






.



Relevant Pages

  • Re: Can SSAS 2005 work in Novell network?
    ... windows account which was used to log on to the local machine. ... the server to the relevant OLAP roles you should be good to go. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.sqlserver.olap)
  • RE: sp_attach_db on Vista causes read only problems
    ... this issue could occur if the SQL Server service ... You may try to use "local system" account as startup ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.sqlserver.setup)
  • Re: Impersonation Question
    ... **a domain account of the domain this machine belong to ... You can not call logonUser API against a local account on another remote ... Microsoft MSDN Online Support Lead ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.languages.vb)
  • RE: 32bit app turns into 64bit in Windows Service
    ... I've changed to both an AD account and the Network Service account, ... will make the process running without the "*32" in the Task Manager. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.general)
  • Re: Forms Authentication Problem
    ... but tries to access some random page and I get redirection Error. ... Microsoft Online Community Support ... where an initial response from the community or a Microsoft Support ...
    (microsoft.public.dotnet.framework.aspnet.security)