trouble changing the default url for forms based authentication 
Author Message
 trouble changing the default url for forms based authentication

I'm using forms based authentication and would like to change the
default url -- the page that is loaded when a user logs in without
originally requesting a page.

For example, if the user's first request is the login page, the page
that is currently loaded after logging in is the default.aspx page
under the application root (/default.aspx). I would like to change
that to a different page. Perhaps someone can suggest how to implement
this change. I looked through the Microsoft website, but was unable to
find the correct documentation. I've posted the authentication section
of my web.config below.

Thanks,

Andrew

######
<authentication mode="Forms">
  <forms name="HazMat" loginUrl="/Users/Login.aspx" />
</authentication>
<authorization>
  <deny users="?" />
</authorization>
######



Sun, 22 May 2005 22:45:20 GMT  
 trouble changing the default url for forms based authentication
It seems that redirecting to Default.aspx is an immutable behavior of the
RedirectFromLoginPage method when it doesn't find a 'ReturnUrl' in the
QueryString... I assume you could check to see if one exists, and if not,
add your own:

   if (Request.QueryString["ReturnUrl"] == "") {
     Request.QueryString.Add("ReturnUrl", "/SomeOtherPage.aspx");
   }
   System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName,
isPersistent);

-Juan Gabriel


Quote:
> I'm using forms based authentication and would like to change the
> default url -- the page that is loaded when a user logs in without
> originally requesting a page.

> For example, if the user's first request is the login page, the page
> that is currently loaded after logging in is the default.aspx page
> under the application root (/default.aspx). I would like to change
> that to a different page. Perhaps someone can suggest how to implement
> this change. I looked through the Microsoft website, but was unable to
> find the correct documentation. I've posted the authentication section
> of my web.config below.

> Thanks,

> Andrew

> ######
> <authentication mode="Forms">
>   <forms name="HazMat" loginUrl="/Users/Login.aspx" />
> </authentication>
> <authorization>
>   <deny users="?" />
> </authorization>
> ######



Mon, 23 May 2005 02:34:17 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to affix variables to URL after authentication w/ ISAPI

2. Providing basic authentication to http-based Web service

3. Certificate based Authentication in .Net WebServices

4. Providing basic authentication to http-based Web service

5. BROWSER SPECIFIC!!! Forms authentication error

6. Form Authentication issue

7. Visual form inheritance from base form implemented in C++ with Managed Extensions (migrated from unmanaged C++)

8. Using Windows Authentication in window form

9. Forms Authentication - Redirect from Login page

10. forms authentication

11. How to fire up the default browser with a URL as parameter

12. How to fire up the default browser with a URL as parameter

 

 
Powered by phpBB® Forum Software