Create membership provider: Optimize the provider to use Sitefinity CMS UI

This step of the tutorial demonstrates how you can integrate your custom membership provider to support the user interface of Sitefinity CMS. The example in this repository is a fully functional implementation of the standard SqlMembershipProvider with support for filtering, paging, search, and sorting.

If you have a small number of users, you can register your custom membership provider in the web.config file. If you have large number of users (~ 10 000 or above), this type of implementation will cause an overhead. The reason is that the MembershipProvider class provides only a single method for filtering users - the GetAllUsers(int pageIndex, int pageSize, out int totalRecords) method. This method uses only paginated data with no support for filtering, searching, or sorting. You can configure custom membership providers to support such functionality by using the IBasicQueryExecutor interface. This way, you benefit from:

  • Loading a small amount of users in memory
  • Faster user management

IbasicQueryExecutor interface

This interface exposes a single method - Execute(QueryArgs args). When decorated on a custom membership provider, this method is called whenever data is retrieved from the custom membership provider with the arguments for filtering, paging, sorting, and searching, provided in the args variable.

Download the Custom membership provider

You can download a fully functional example of a custom membership provider that is optimized to use Sitefinity CMS UI from Sitefinity CMS GitHub custom-membership-provider.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?