Copied to clipboard

Flag this post as spam?

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


  • Arturo Soler 24 posts 77 karma points
    Nov 28, 2014 @ 16:15
    Arturo Soler
    1

    UmbracoMembershipProvider members.Login autologin from Windows Authentication

    I took several days trying to link windows authentication with umbraco members.  The idea is simple and there are enough entries in this forum, even a package for earlier versions (I'm on 7.1.8).

    The idea is simple and there are enough entries in this forum, even a package for earlier versions (I'm on 7.2)

    Create a document type autologin with the following template

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using System.Web.Mvc;
        
    @{
        Layout = null;
        var nombreUsuario = HttpContext.Current.User.Identity.Name
                                            .ToLower()
                                            .Replace(@"dominio\""");
        var miembro = Membership.GetUser(nombreUsuario);
        if (miembro == null) 
        {
            miembro = Membership.CreateUser(nombreUsuario, 
                                            "121dfgslieg",
                                            "dummy@dummy.es");
            Roles.AddUserToRole(nombreUsuario, "Normal");
        }
        Members.Login(nombreUsuario, "121dfgslieg");
        Response.Redirect(Request.Url.ToString());
    }

    At Umbraco Content:

    • Create an autologin page based on this type and template and an empty page for errors.
    • Set up public access rorel based on the root node leading and point to auto-login page as login.
    • Disable anonymous access in IIS and enable Windows integrated authenticacion.

    Before getting the proper method (Members.Login) if the autologin failed, the application went into a loop page-login-page-login -... etc. After a few tries everything worked fine in IIS Express (visual studio 2013) but the loop play again when I moved to IIS 7.5.

    Furthermore, back to IIS Express it occurred to me to try Internet Explorer 10 (previous tests had been with Chrome) And again appeared the loop!!!

    Currently I have decided not to use Umbraco members but I have curiosity, because there must be some explanation. Maybe because we are actually working with System.Web.Security?

    Any suggestions?

  • Ankur parekh 5 posts 74 karma points
    Nov 03, 2016 @ 19:37
    Ankur parekh
    0

    Hey Arturo,

    Can you please help me with Windows authentication I am using 7.5.4. I want to configure Active Directory also. Thanks in advance!

    Ankur

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies