6686 Views // 0 Comments // Not Rated

The Hybrid Provider 2.0 - Released On CodePlex

I've finally completed the 2.0 Code Plex release of the Hybrid Provider There are three major areas in which I have made improvements.

  • Profiles
  • Support for multiple web apps on the same farm
  • Better and more WPF-er installer.


I've added the Hybrid Profiler, which in the same spirit as the Hybrid Provider, maintains user profile information for both AD and SQL accounts.

Multiple Web Apps

There have been some issues that have resulted in major hacks being necessary for getting two or more web apps on the same farm to work with the Hybrid Provider. I've changed the installer to have a drop down of all the web apps, specifying which ones have the Hybrid Provider / Hybrid Profiler installed. This way, you can configure different user data stores for your SQL users.

If you want them all to use the same database, just go into the app settings in each web.config after installation, and give all the "HybridProvider_ApplicationName" keys the value of the one in the web.config of web app you want to use. Also, do this for the central admin web.config as well. This value defaults to the URL of the web app. Note that based on the architecture of the ASP.NET profile and membership infrastructure, the Hybrid Profiler needs to use this same setting. By default, the name of the application is just a slash ("/").

Finally, you can deactivate the Hybrid Provider form one web app, leaving intact in others. It is only actually removed when you use the Hybrid Profiler Installer to uninstall it from the last web app it is activated on. Due to dependencies, you cannot uninstall the Hybrid Profiler independently (although it is optional to install).

These improvements should really open up the situations in which the Hybrid Provider can be used, especially in farms with multiple web apps. It should also minimize the amount of tweaking you need to do manually. I've upped all the version numbers to 2.0 so it should install side by side with the Hybrid Provider 1.0.

The Hybrid Provider Installer

If you used the first version of the Hybrid Provider Installer, you'll think this version has made a cameo appearance on Nip/Tuck. I've replaced a lot of the guts with WPF databinding, so now the Install / Uninstall buttons (and others) will only be enabled when appropriate. Also, I've added a lot of gratuitous animations that make navigation fun and exciting!

Here's what the main screen looks like:

Hybrid Provider Installer

Also, I've added multithreading so that the UI has a responsive notification of what features are currently being installed. After installation is complete, a nice list of all the operations, and their outcomes, is shown instead of a message box. Finally, I've been able to remove even more of the inputs and get their values elsewhere, so that there's less possibility for error.

A cool thing we get from WPF is the ability to place arbitrary content inside almost any control. This includes the combo box. So, I was able to put bulleted lists inside of each combo box item, with a title. That first control has all the web apps in the current farm, and lists which of the three features available in this release are currently activated.

Installation Tips

  • The installer needs some intense permissions around the farm to properly execute all of installation tasks I've been able to automate.  For best results, run the installer using the same account that is running the app pool of the web app you specify to set up the Hybrid Provider on.
  • If this account does not have access to the SQL aspnet database, (which it probably shouldn't) feel free to create a SQL account and use SQL auth for the connection string.
  • If the combo box of sites is blank, then the account you are running the installer under doesn't have proper permissions to iterate the farm's web apps.  These are generally the credentials you specified when SharePoint was first installed.  Again, plan well: have a SharePoint "Jesus" account that has full permissions on the farm and IIS, and next to nothing on the server.  

Upgrade Tips From 1.0 To 2.0

  • Of course, back up all your web.config files first.
  • If you customized your login page, back up UserLogin.aspx as well.
  • If you still have the 0 installer, use that to uninstall the Hybrid Provider.
  • Otherwise, since this installer is a different version than the last, it won’t be able to pick up the originally-installed settings from isolated storage.  However, you should still be able to select the web app you have 0 installed on from the combo box at the top.  It will pick up that the Hybrid Provider is installed.  Select this web app in the combo box and click “Uninstall” at the bottom.  The uninstaller will do its thing, most notably, uninstall the Hybrid Provider feature.  Deactivation might fail, but the important thing is that it uninstalls.
  • If either installer fails to delete any files, it’s probably due to the fact that they are read-only.  When the installer completes, for all of the results that have red X’s, note the directory /file that failed to uninstall, and go remove it manually.
  • Once the Hybrid Provider is uninstalled and its files cleaned up, use the 0 installer to set everything up, including the Hybrid Profiler.

Miscellaneous Updates

  • The Hybrid Provider's feature receiver will now inspect your current site collection administrators, and replace them with equivalent Hybrid Provider accounts.  Now, you can run the installer, and then immediately log into your portal with the new authentication mechanism completely in place!
  • I've added a TON of new helper methods to the Hybrid Provider class, and other utilities, that will reduce any code you need to write for customization.  Here are a few to point out:
    • HybridProvider.IsSQLUser(string userName) -> Many times I've needed to know where the current user is coming form.  IsSQLUSer will tell you if the userName passed in is has been authenticated via SQL or AD.  This is a great "quickie" that the Hybrid Profiler makes extensive use of.
    • HybridProvider.GetNumWebAppsFeatureIsInstalledOn(string featureDisplayName) -> This returns the number of web applications in which the passed in feature name (e.g. "HybridProvider") is activated on.  This is what allows the uninstaller to know weather to deactivate or uninstall each feature.
    • FeatureHelpers -> A new class that wraps the SPWebConfigMoficiation class to do a lot of the web.config updates.
  • For both the Hybrid Provider and Hybrid Profiler, there are two ways to use their functionality from your code.  The first way is to use Catalyst.SharePoint.Utilities.ProviderHelpers.NewProvider() or Catalyst.SharePoint.Profiles.ProfileHerlpers.NewProvider() respectively.  However, I've improved the code so that you can now also use the static ASP.NET class to get a reference to these providers.  These are  System.Web.Security.Membership (for Hybrid Provider) and System.Web.Profile.ProfileManager (for Hybrid Profiler).  They're are more efficient, and are the way SharePoint does it.  Both have a "Provider" property that you can cast into either of my Hybrid classes if you need to use extended functionality beyond either's base class.

Fun animation spoiler:

Hybrid Provider Installer Animation

Have fun!

5 Tags

No Files

No Thoughts

Your Thoughts?

You need to login with Twitter to share a Thought on this post.