Custom User Registration

Posted by Community Admin on 03-Aug-2018 17:03

Custom User Registration

All Replies

Posted by Community Admin on 13-Jan-2011 00:00

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

Posted by Community Admin on 13-Jan-2011 00:00

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

Posted by Community Admin on 13-Jan-2011 00:00

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?

Posted by Community Admin on 13-Jan-2011 00:00

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

Posted by Community Admin on 14-Jan-2011 00:00

Can you provide an example of what the credentials should be for the AuthenticateUser() on SecurityManager.

Posted by Community Admin on 17-Jan-2011 00:00

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

Posted by Community Admin on 21-Mar-2011 00:00

"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'

Posted by Community Admin on 25-Mar-2011 00:00

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

Posted by Community Admin on 29-Jul-2011 00:00

"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.

Posted by Community Admin on 01-Aug-2011 00:00

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

This thread is closed