Try Now
More in this section

Forums / General Discussions / Custom Authentication and Registration

Custom Authentication and Registration

2 posts, 1 answered
  1. Daniel
    Daniel avatar
    35 posts
    15 Jun 2010
    24 Aug 2010
    Link to this post

    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,
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    25 Oct 2016
    25 Aug 2010
    Link to this post
    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
2 posts, 1 answered