I have a requirement in a project for a back office user to login via a custom login page in order to access a custom area of the site which exists outside of the Umbraco back office. I'm struggling to get it working and it doesn't create a good experience for the user to use the Umbraco login page then have to put in the url they were heading for afterwards.
I've tried a number of ways and looked at the Umbraco source and a lot of what I need seems to be tied up inside of internal methods which I can't use. The following unfortunately only works for me after logging in via the normal login page first:
var provider = Membership.Providers["UsersMembershipProvider"];
if (provider.ValidateUser(data.Username, data.Password))
{
FormsAuthentication.SetAuthCookie(data.Username, false);
return RedirectToAction("Create", "RegistrationManager");
}
I've been doing some digging and have so far not found a way to specify what membership provider is used in conjunction with the FormsAuthentication.SetAuthCookie method.
Am I overcomplicating this and missing an obvious solution? I think possibly not as looking at the Umbraco source the back office login does not appear to be straight forward either.
v6 Log Back office User in via Custom Login Form
I have a requirement in a project for a back office user to login via a custom login page in order to access a custom area of the site which exists outside of the Umbraco back office. I'm struggling to get it working and it doesn't create a good experience for the user to use the Umbraco login page then have to put in the url they were heading for afterwards.
I've tried a number of ways and looked at the Umbraco source and a lot of what I need seems to be tied up inside of internal methods which I can't use. The following unfortunately only works for me after logging in via the normal login page first:
I've been doing some digging and have so far not found a way to specify what membership provider is used in conjunction with the
FormsAuthentication.SetAuthCookie
method.Am I overcomplicating this and missing an obvious solution? I think possibly not as looking at the Umbraco source the back office login does not appear to be straight forward either.
Any help or advice appreciated?
Thanks, Simon
is working on a reply...