FormsAuthentication.RedirectFromLoginPage()



Greetings MS ASP.Net Community,

I am using forms authentication for a site we've been developing. All users
valid on our Windows domain are eligible to access the site, but are
enrolled in the application upon initial login by insertion of a record into
a [User] table located in a SQL Server database. Insertion of this record
creates an "anonymous" machine generated user ID for them. (The system is a
ride sharing / carpool application and implements a double blind messaging
feature.) New users are also required to agree to the "Terms of Service"
that our legal dept. has composed for this application. So, the login form
is taking care of all of this for me. It only grants an authentication
ticket after verifying that:

1. the user is on the domain
2. the user has been enrolled by insertion into the [User] table
3. the user has agreed to the current "Terms of Service"

Normally, an existing user is redirected from login to a default page
showing their matching commuters (where they can message potential matches
anonymously, etc.) However, when the user is a brand spanking new user who
is accessing the site for the first time I would like to redirect them from
the login page to a "welcome" page that informs them about their anonymous
ID and the double-blind messaging feature, etc.

The problem I seem to have is that when I manually add the cookie for the
authentication ticket to the outgoing cookies collection and try to invoke a
statement such as:

Response.Redirect("Welcome.aspx", False)

the user is not redirected, but receives the login page again.

Is it possible to redirect from the login page to a page other than the one
requested by the user ... i.e. FormsAuthentication.GetRedirectURL()?
Seemingly, I can only redirect the user from the login page via:

FormsAuthentication.RedirectFromLoginPage()

Ok, I think that pretty much sums it up.

Any help will be greatly appreciated.

Sincerely,
Mark



.



Relevant Pages

  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Default.aspx - newbie Q`
    ... check and redirect to the ReturnURL or Selected.aspx depending on the case. ... > and replace it with something that takes then straight to the login page. ... >> Curt Christianson ... >>> authentication ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASP 2.0 Membership API
    ... After successful authentication, you want to redirect back to the original application, but the returnURL parameter contains only /App1 as the URL. ... The solution to that problem is adding a local login page to the application that does a manual redirect to the central authentication application. ... if not you have to use cookieless auth ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Detecting Failed Authorization
    ... after every authentication request and before the user ... is redirected to any login page. ... > "Ken Dopierala Jr." ... >> 'Redirect where you want the user to go. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Response.Redirect with IE
    ... login page to another one after a successful login - Am I right? ... In that case, set the Authentication mode to "Forms" in Web.Config, set the ... You don't have to manually redirect, Forms Authentication will do it for you ... > From: Ken Dopierala Jr. ...
    (microsoft.public.dotnet.framework.aspnet)