Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Joachim Andersen 38 posts 198 karma points
    May 02, 2014 @ 12:16
    Joachim Andersen
    0

    UmbracoUrlAlias and protected pages

    I have a customer that has protected areas on their site. They have added an alias (in the UmbracoUrlAlias field) to a protected page and expect that they can give this link to their users. The problem is that when you navigate to this url it redirects to the login page meaning that the originally requested page is "forgotten". I would expect that accessing a page directly or by its alias would result in the same. I'm not sure if it is a bug or a feature :)

    Any suggestions?

    Cheers, Joachim

  • Kasper Holm 47 posts 180 karma points
    May 02, 2014 @ 13:06
    Kasper Holm
    0

    Hi Joachim

    I belive it's a feature, the url alias is made so you can overwrite the auto generatet url, if you have a page you need to view with out protection, then i believe you have to remove protection. I dont belive that you can remove the protection for the page when the the parrent page is protected :/

    is it possible to move the node to anther section and hide it in menues ? :)

  • Joachim Andersen 38 posts 198 karma points
    May 05, 2014 @ 14:17
    Joachim Andersen
    0

    Hi Kasper,

    I'm not sure I understand.

    I have a page that is protected, when navigating to it I'm presented with the login page I selected inside the backoffice. If I here login I'm sent to the page I requested before being sent to the login page. So I'm not trying to make a child to a protected page public accessible but just navigating to it.

    If I repeat this with the alias it never sends me back to the originally requested page. Is that what you mean is a feature?

    Cheers, Joachim

  • Kasper Holm 47 posts 180 karma points
    May 05, 2014 @ 14:38
    Kasper Holm
    0

    oh i misunderstood then, well thats wierd, and defently not a feature.

    Do you redirect the user with a return url ?

    or do you just let umbraco handle it ? i've seen some wonkyness when umbraco handles it, but what you want is to redirect the user after login to the page they were viewing

    here is a quick example i just made :)

    [HttpPost]
    public ActionResult LogIn(MemberLogIn model)
    {
       var url = Request.UrlReferrer.AbsoluteUri;
    
       if (Membership.ValidateUser(model.MemberLogInName, model.Password))
       {
           FormsAuthentication.SetAuthCookie(model.MemberLogInName, true);   
       }
       else
       {
          url += "?badLogin=1";
       }
    
        return Redirect(url);
    }
    
  • Charles Afford 1163 posts 1709 karma points
    May 05, 2014 @ 16:53
    Charles Afford
    0

    Hi Joa,

    Can you post any of the code you are using?  It sounds like you are not authenticating the user or cookies/session are not being set properly.

    When i guess is happening is you are logging in

    Going to the authticated page

    check for auth on page = false

    Redirected to login

    Charlie :)

  • Joachim Andersen 38 posts 198 karma points
    Jun 17, 2014 @ 07:06
    Joachim Andersen
    0

    Thanks for your replys. We are using webforms for the solution, but we have decided to convert it to MVC so here I will have to rewrite the login part anyway. Lets see if that fixes the issue . . .

    Cheers, Joachim

Please Sign in or register to post replies

Write your reply to:

Draft