A few people asked me whether there is a way to upgrade and adapt the well known utility published at http://fba.codeplex.com to recent SharePoint 2010. I did that task and here I’m publishing it as an example. The download is at the end of this article. I however started rather from the scratch with my Visual Studio 2010 solution. I made up my mind in this regard due to a couple of reasons. Firstly the upgraded original solution looked awfully in Visual Studio 2010. Secondly essential changes were required to accomplish this task, which I’m referring to below.
What is different in this solution package? The basic problem I was facing is that the Claims Based Membership Provider (SPClaimsAuthMembershipProvider class within Microsoft.SharePoint.dll) stopped supporting a couple of methods which worked in the earlier SharePoint 2007 version 12. Calling them (GetUser, FindUserByName, FindUserByEmail) now will throw a not implemented method exception (Picture 1). This new restriction made a proper design somewhat challenging as there is no way to get exactly one user from the underlying membership database. Instead you have to load all users and filter them in the memory.
Picture 1 (Red Gate’s disassembler reveals the catch)
The former version of this provider loaded anyway all users each time you have asked for one particular. Hence fore neither the old nor this new utility can deal with a large number of membership users. Due to the reason SharePoint 2010 is only 64 Bit, this looks like not a real obstacle while the number of users does not explode beyond several thousands.
Here the list of changes in this new version:
- Support for Security Question (RequiresQuestionAndAnswer property). The utility checks whether the underlying provider is configured to support this property and the concerned controls are grayed out or switched on appropriately.
- Supporting caching capability. This means the user can decide to use ASP.NET caching on the server which will lower database round-trips to the server (if SQL Provider).
- Supporting search for one particular user
Picture 2 (Site Collection’s Site Settings)
Picture 3 (Manage Forms Based Authentication Users)
Picture 4 (Find particular user – no wildcard support yet)
Picture 5 (Edit User; note support for Security Question)
Picture 6 (New User)
Picture 7 (Breadcrumb navigation support)
Picture 8 (Managing Roles)
Please note you have to adapt the deployment scripts to your current environment (the scripts are part of the download package). Simply uncomment the path to folder 14c if needed and insert your site-collection’s URL.
Picture 9 (Installation script)
Picture 10 (Uninstallation script)
Here goes the Download to the zipped wsp solution package (the Visual Studio Solution Source Code will be published later on this web site – I’m going to add a few comments for developers). Downloading the package you are accepting the Microsoft Shared Source Community License (SS-CL) Agreement. Please note there is no support for this solution. I however appreciate your posted comments in this regard.