Email as UserName
Hi there,
How can I register users with the email as username?, so they can login with email and password.
Regards.
Hello,
Please take a look at this forum for solution and let me know if you have more questions.
Regards,
Veronica Milcheva
the Telerik team
Hi,
To register a user with its e-mail as username use this API for Sitefinity 5.
var userManager = UserManager.GetManager(
"Default"
);
System.Web.Security.MembershipCreateStatus status;
userManager.Provider.SuppressSecurityChecks =
true
;
var user = userManager.CreateUser(
"user1@test.com"
,
"user1234@"
,
"user1@test.com"
,
"Question"
,
"Answer"
,
true
,
null
,
out
status);
user.FirstName =
"FirstName"
;
user.LastName =
"LastName"
;
userManager.SaveChanges();
RoleManager roleManager = RoleManager.GetManager(
"AppRoles"
);
roleManager.Provider.SuppressSecurityChecks =
true
;
var role = roleManager.GetRole(
"Administrators"
);
roleManager.AddUserToRole(user, role);
roleManager.SaveChanges();
Hello,
You can share them in Sitefinity marketplace .
Kind regards,
Stanislav Velikov
the Telerik team