+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Email as UserName

Email as UserName

6 posts, 2 answered
  1. Desiderio
    Desiderio avatar
    21 posts
    Registered:
    26 Apr 2012
    14 May 2012
    Link to this post
    Hi there, 

    How can I register users with the email as username?, so they can login with email and password.

    Regards.
  2. Veronica
    Veronica avatar
    125 posts
    Registered:
    30 Jan 2015
    15 May 2012
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Desiderio
    Desiderio avatar
    21 posts
    Registered:
    26 Apr 2012
    15 May 2012
    Link to this post
    Hi Veronica,

    Thanks for the answer, I found this file: http://www.sitefinity.com/ClientsFiles/179057_createuserwizard.zip,
    and I try to add this control, but it´s missing an assembly reference "using Telerik.Security;", I´m on Sitefinity 5

    Regards.
  4. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    19 May 2012
    Link to this post
    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();
    You can find more information for users API in the documentation.

    All the best,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
  5. Desiderio
    Desiderio avatar
    21 posts
    Registered:
    26 Apr 2012
    21 May 2012
    Link to this post
    Hi, Stanislav Velikov 

    Thanks it works fine, I made my custom control, by the way is there some kind of repository to share custom widgets? 

    Best Regards.
  6. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    Registered:
    08 Dec 2016
    24 May 2012
    Link to this post
    Hello,

    You can share them in Sitefinity marketplace .

    Kind regards,
    Stanislav Velikov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
    Answered
6 posts, 2 answered