FBA Utility Source Code

I have promised to publish the complete solution with a few comments. First of all please note that upgrading the original Visual Studio 2008 solution (which was published on codeplex) to VS2010 will work, however note the obsolete project structure (Picture 1) you will experience after succeeded upgrade.  Picture 2 depicts the newly created solution which looks and feels more like an appropriate SharePoint 2010 project.

image
Picture 1 (Migrated)
image
Picture 2 (New Solution)

So the new solution consists of one Package, one Feature, one Custom-Action element and several Application Pages. The Feature targets a Web Site (SPWeb) as it did the previous solution. The Feature’s Event Receiver (Code 1) updates the site’s breadcrumb navigation map (Code 2) across the Server Farm submitting a new job. Note the commented out last line which would achieve the very same effect, however only locally. This means the alternative single line solution will work only in a single server scenario. The UpdateLayoutSitemap class was simply moved to this recent solution via copy & paste. Just check out if you wonder how such farm-wide job could be issued.

image

Code 1

image

Code 2 – layouts.sitemap.FBAUserRoleManager.xml

The CustomActionElement (Code 3) is intended to inject the new FBA Group (displaying the 48×48 security icon) and the two links into the Site Settings’ page (Picture 3).

image

Code 3 – Elements.xml

image

Picture 3

Completely new is the Utils.cs file holding the Utils class intended to deal with the Role, Membership and MembershipUser classes (System.Web.Security namespace) representing the key business logic pieces of this recent utility. These classes’ method-calls are routed through the SharePoint’s pre-configured membership provider as discussed in my previous article (SPClaimsAuthMembershipProvider). This utility class reads, writes, updates, deletes and caches users and roles as requested.

I have refreshed and reorganized almost every Application page and added a few new pages in order to support new functionality. I left out completely the option to switch between providers. The former utility’s author already noted, it does not make too much sense as one site collection will normally target only one claims based authentication provider.

Downloading the package you are accepting the Microsoft Shared Source Community License (SS-CL) Agreement.

http://cid-8d365142bc4869ab.office.live.com/self.aspx/.Documents/FBAUserRoleManager.zip

Advertisements
This entry was posted in SharePoint 2010. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s