Well there was allot of changes regarding membership since Umbraco 4 etc... and Default .Net membership was added as Profile authentication in Umbraco (as far as I can say). Considering I am not Umbraco pro. developer... And never attended any of the webinars nor certifications.
In Old days, it was enough to write user control.
Today we have things like Json, AngularJS, Oauth and .Net membership and different membership providers.
But still there should be a fairly standard way for people to add this feature to a new project? Or atleast some ideas on approaching authentication in Umbraco.
If you a looking for basic member login form for Umbraco in Razor, then there are one pre-code snippet in Umbraco.
It´s contains this code:
@using System.Web.Mvc.Html
@using ClientDependency.Core.Mvc
@using Umbraco.Web
@using Umbraco.Web.Models
@using Umbraco.Web.Controllers
@{
var loginModel = new LoginModel();
Html.EnableClientValidation();
Html.EnableUnobtrusiveJavaScript();
Html.RequiresJs("/umbraco_client/ui/jquery.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.min.js");
Html.RequiresJs("/umbraco_client/Application/JQuery/jquery.validate.unobtrusive.min.js");
}
@* NOTE: This RenderJsHere code should be put on your main template page where the rest of your script tags are placed *@
@Html.RenderJsHere()
@using (Html.BeginUmbracoForm<UmbLoginController>("HandleLogin"))
{
<fieldset>
<legend>Login</legend>
@Html.ValidationSummary("loginModel", true)
@Html.LabelFor(m => loginModel.Username)
@Html.TextBoxFor(m => loginModel.Username)
@Html.ValidationMessageFor(m => loginModel.Username)
<br />
@Html.LabelFor(m => loginModel.Password)
@Html.PasswordFor(m => loginModel.Password)
@Html.ValidationMessageFor(m => loginModel.Password)
<br />
<button>Login</button>
</fieldset>
}
There are also other pre-code snippet regarding to login functionality like login status. You can find it, when you create a new partial view or partial view macro file.
I have added a screenshot so you can see where to find it.
Basic member login form Umbraco
Well there was allot of changes regarding membership since Umbraco 4 etc... and Default .Net membership was added as Profile authentication in Umbraco (as far as I can say). Considering I am not Umbraco pro. developer... And never attended any of the webinars nor certifications.
In Old days, it was enough to write user control. Today we have things like Json, AngularJS, Oauth and .Net membership and different membership providers.
But still there should be a fairly standard way for people to add this feature to a new project? Or atleast some ideas on approaching authentication in Umbraco.
I think this article explains the memberships a bit: https://our.umbraco.org/documentation/reference/management/services/memberservice
Hi Dmitrij :-)
If you a looking for basic member login form for Umbraco in Razor, then there are one pre-code snippet in Umbraco.
It´s contains this code:
There are also other pre-code snippet regarding to login functionality like login status. You can find it, when you create a new partial view or partial view macro file.
I have added a screenshot so you can see where to find it.
Hope this helps,
/Dennis
Hi Dennis and Vaidas,
Thanks allot for useful link, and for the info. Dennis, must give credit to you cause that is exactly what I was looking for! :-)
Thank you very much very much for help guys! :-)
is working on a reply...