Custom Authentication and Registration

Posted by Community Admin on 03-Aug-2018 10:04

Custom Authentication and Registration

All Replies

Posted by Community Admin on 24-Aug-2010 00:00

Greetings,


Is there currently a way to Authenticate and / or Register a user with specific details by code?

Basically I'm in need of a custom Login panel where users type in their username and password and when submitting them I can authenticate them while also checking other aspects of their profile.

The second functionality I need to obtain is to have a custom registration module, each user on the system will have to fill several custom fields which will have to be stored in the database, the registration system will then have to send this user an email with a code for them to validate their registration and as soon as they do this the registration will need to be marked as "Pending Administrator Approval". Once an administrator approves this account then the user will receive another notification email and he may start using the website. This user will also need to be in some sort of group which has access to private parts of the website.

To do this I first considering creating a registration form with all the needed fields, when the user registers then it would call some internal Sitefinity method to normally register the user and return the User Id, I would then proceed to store the extra information on another table for this User Id. Is there any better way to achieve this?

Thanks in advance.

Best regards,
Daniel 

Posted by Community Admin on 25-Aug-2010 00:00

Hi Daniel,


You can use

Telerik.Sitefinity.Security.SecuityManager - represents an intermediary between security objects and security data.

Telerik.Sitefinity.Security.UserManager - represents an intermediary between users and membership data providers.

For profile data you can use  Telerik.Sitefinity.Security.ProfileManager

  •    Profile CreateProfile(User user) - creates a new profile.
  •    CreateProfile(User user, Guid profileID) - Creates a new profile with the specified identity.
  •    GetProfile(Guid profileID) - Gets a  profile.
  •    GetProfiles() - Gets a query for profiles.
  •    Delete(Profile item) - Deletes the specified profile
For registering users you can use CreateUserWizard control and set DisableCreatedUser property. The UserManager class has a method - UnlockUser which you can use to validate the user later and enable it.
UserManage.GetUser() will return you User object from where you can get ProviderUserKey. You can use System.Net.MailMessage to send an email. The email should contain a link with some query string keys that you can use to identify the user and make some changes when the link is clicked. The QueryString keys could be encrypted and then decrypted.

Kind 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

This thread is closed