Custom membership provider: Example of using the custom membership provider
Login to the backend of Sitefinity CMS using the Default authentication provider. Open the Users page by clicking Administration » Users. Above the toolbar of the page, you can see all available providers, including the one you created - Customer Support.
When you click Customer Support, an empty list is shown, since you have not yet created any users.
You already implemented the logic in the provider to create and delete users from Sitefinity CMS backend, so when you click Create a user button, you create an actual customer record inside our database.
When you fill out the fields, Sitefinity CMS creates the link between the Sitefinity CMS user and the profile information. Inside this profile information, Sitefinity CMS stores data such as Firstname and Lastname.
You can then choose which provider you want to use for the user and you can decide whether you want to make this user a backend user or if the user is a public user.
As an example, use the following values for this new user:
Username |
Sfcustomer |
Password |
Membership2013
|
Confirm password |
Membership2013
|
Email
|
user@customers.com |
Firstname
|
Custom
|
Lastname
|
Member
|
Is a public profile
|
True
|
This user can access site backend
|
True
|
Provider
|
CustomMembershipProvider
|
Roles
|
Authors
|
When you are done, click Create this user and you return to the users grid, which now shows the new user.
Because you have enabled Access site backend, you can test this by performing the following:
- Log out of Sitefinity.
- Navigate to the login page again.
- In Authentication Provider, choose CustomMembershipProvider.
- To login, use the credentials for the new user.
You have successfully logged in to Sitefinity CMS using the custom membership provider.