+1-888-365-2779
Try Now
More in this section

Forums / Security / Forum not redirecting anonymous users to loginUrl

Forum not redirecting anonymous users to loginUrl

4 posts, 0 answered
  1. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    08 Jun 2009
    Link to this post
    In my web.config, I have
        <authentication mode="Forms"
          <forms name=".ASPNET" loginUrl="~/sitefinity/login.aspx" protection="All" timeout="1440" path="/" /> 
        </authentication> 

    However, when I am not logged in on my forum page (CMS/Forum.aspx), and I want to create a new thread the URL ends up being "CMS/Forum.aspx?ReturnUrl=%2fCMS%2fForum.aspx".

    I had expected it would go to "CMS/sitefinity/login.aspx".

    Where is the disconnect?
  2. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    08 Jun 2009
    Link to this post
    Reflector hasn't really cleared much up.  I would have expected a redirect to the loginUrl rather than just appending the ReturnURL.


       if (!isAuthenticated && denyAnonymous) 
        { 
            string url = string.Empty; 
            if (string.IsNullOrEmpty(this.loginPage)) 
            { 
                url = HttpContext.Current.Request.Url.AbsolutePath; 
            } 
            else 
            { 
                url = this.loginPage; 
            } 
            if (url.IndexOf('?') != -1) 
            { 
                urlurl = url + "&"; 
            } 
            else 
            { 
                urlurl = url + "?"; 
            } 
            urlurl = url + "ReturnUrl=" + HttpContext.Current.Server.UrlEncode(this.GetReturnUrl()); 
            this.Page.Response.Redirect(url); 
        } 
     

  3. David
    David avatar
    22 posts
    Registered:
    04 May 2009
    08 Jun 2009
    Link to this post
    So if I don't specify a value for the LoginPage, it essentially goes nowhere?  I would have expected it to use the loginUrl specified in web.config.  What was the reason for taking this approach?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Jun 2009
    Link to this post
    Hi David,

    Similar issues with all not Generic content based modules will be fixed from version 4.0. We are going to migrate forums, Polls etc so that they will implement the same logic as the other modules. The logic of the control has not been changed since version 3.2, we were doing only bug fixing and there are some small problems in the module.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
4 posts, 0 answered