Copied to clipboard

Flag this post as spam?

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


  • John Harwood 1 post 21 karma points
    Apr 27, 2012 @ 18:16
    John Harwood
    0

    Mixed Authentication

    I am trying to do mixed authentication so that our Active directory users can log in with their AD logins but still allow Umbraco to control the memberships and roles.  The way I have done this in the past is to onAuthenticate validate the AD login and if that validates then replace the password with a default one that the membership and roles db will authenticate with.  In the code shown below the AD account validates but the ValidateUser does not.  Even with a non-AD user it still doesn't validate.  How do I validate against the Umbraco DB?  Thanks in advance for the help.

         protected void uxLogin_OnAuthenticate(object sender, AuthenticateEventArgs e)
         {
              string passw = uxLogin.Password.ToString();
              if (Common.ValidateActiveDirectoryLogin(ConfigurationManager.AppSettings.Get("Domain"), uxLogin.UserName, passw) == true)
              {
                   passw = ConfigurationManager.AppSettings.Get("Pword");
              }
              UmbracoMembershipProvider UmbracoMembership = new UmbracoMembershipProvider();
              e.Authenticated = UmbracoMembership.ValidateUser(uxLogin.UserName, passw);
         }

     

  • Richard Barg 358 posts 532 karma points
    Mar 12, 2013 @ 00:00
    Richard Barg
    0

    John,

    Did you ever get an answer?

  • 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