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

Forums / General Discussions / Custom User Registration

Custom User Registration

10 posts, 0 answered
  1. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    13 Jan 2011
    Link to this post
    I have implemented a custom user control that adds a new user as a new Sitefinity user because there is not a CreateUser control included in the Sitefinity system.  However, when I am not logged in already I receive the error message saying "You are not authorized to 'Manage Users' ('Backend').".  Is there a way around this to allow a user to be added?  I would like to utilize the sitefinity users/roles functionality with this.

    Thanks,
    Alex Lorenz
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Jan 2011
    Link to this post
    Hello Alex,

    To register a user you can use the standard ASP.NET CreateUserWizard control. You are getting the message, because you are not logged as a user that can create other users or you have not granted "Anonymous" with permissions for create.

    There is an option to suppress the security check, but it should be used only as an exception.

    userManager.Provider.SuppressSecurityChecks = true;


    All the best,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Alex
    Alex avatar
    39 posts
    Registered:
    19 Jul 2010
    13 Jan 2011
    Link to this post
    Another issue I'm fighting is actually logging in the user after the user is registered.  After looking at a couple other forum posts, I tried the following, but it is saying there is no definition for SetAuthenticationCookie.

    SecurityManager.SetAuthenticationCookie(SystemManager.CurrentHttpContext.Response, Membership.Provider.Name, username, false);

    Any thoughts?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 Jan 2011
    Link to this post
    Hi Alex,

    You can use AuthenticateUser   method which can be accessed.

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Doug
    Doug avatar
    34 posts
    Registered:
    20 Sep 2010
    14 Jan 2011
    Link to this post
    Can you provide an example of what the credentials should be for the AuthenticateUser() on SecurityManager.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    17 Jan 2011
    Link to this post
    Hello Alex,

    You can use this overload.

    AuthenticateUser(string membershipProviderName, string userName, string password, bool persistent, out User user)

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Amanda Shafer
    Amanda Shafer avatar
    198 posts
    Registered:
    12 Oct 2012
    21 Mar 2011
    Link to this post
    "To register a user you can use the standard ASP.NET CreateUserWizard control. You are getting the message, because you are not logged as a user that can create other users or you have not granted "Anonymous" with permissions for create."

    How do we grant permissions for Anonymous to create an account?

    I went into Administration > Permissions. Global Permissions. Who can...
    I selected Manage Users - Everyone, Authenticated, Anonymous
                    Manage Roles - Everyone, Authenticated, Anonymous

    I still get the message:

    You are not authorized to 'Manage Users' ('Backend'
  8. Alon Rotem
    Alon Rotem avatar
    26 posts
    Registered:
    29 Feb 2016
    25 Mar 2011
    Link to this post
    Hi Amanda,

    I tried to reproduce the error, but, alas, without luck.
    I started with a fresh Sitefinity project, added an aspx page to my solution, put a CreateUserWizard on it like so:
    <asp:CreateUserWizard ID="creator" runat="server"></asp:CreateUserWizard>
    Then on the Sitefinity UI, I went to
    Administration > Permissions. Global Permissions. Who can...
    I selected Manage Users - the Everyone radio button.
    Then I logged out, went to my page, and created the user successfully as anonymous.

    I have tested this both on the RC2 version of Sitefinity and on our latest code version. Without setting the permissions for Manage Users (i.e. leaving the default "Administrators only"), I got the exception "You are not authorized...".

    Could you please try this simple scenario on your system and see if it works similarly for you?
    If it does, what is it that you do differently?
    If it does not, could you please provide us with your database dump, and a copy of your Sitefinity web solution?
    Thank you.


    Best wishes,
    Alon Rotem
    the Telerik team
  9. Ryan Dailey
    Ryan Dailey avatar
    41 posts
    Registered:
    08 Mar 2010
    29 Jul 2011
    Link to this post

    "There is an option to suppress the security check, but it should be used only as an exception.

    userManager.Provider.SuppressSecurityChecks = true;"

    User registration would be an exception, right?  It sounds better than giving the Anonymous role write access on the roles and users.

  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    01 Aug 2011
    Link to this post
    Hi Ryan,

    It is better to suppress the check when you create the user userManager.Provider.SuppressSecurityChecks = true

    then, after the use has been created set the check back to false

    userManager.Provider.SuppressSecurityChecks = false.


    Greetings,
    Ivan Dimitrov
    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
10 posts, 0 answered