<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
>

<channel>
	<title>From the Desk of Brandon Haynes &#187; Microsoft Commerce Server</title>
	<atom:link href="http://blogs.law.harvard.edu/brandonhaynes/category/technology/microsoft-commerce-server/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.law.harvard.edu/brandonhaynes</link>
	<description>Observations about the intersection of technology, business, and intellectual property</description>
	<lastBuildDate>Wed, 21 Oct 2009 16:14:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/us/</creativeCommons:license>
		<item>
		<title>Downloads: Commerce Server UpmMembershipProvider and DotNetNuke</title>
		<link>http://blogs.law.harvard.edu/brandonhaynes/2009/06/17/downloads-commerce-server-upmmembershipprovider-and-dotnetnuke/</link>
		<comments>http://blogs.law.harvard.edu/brandonhaynes/2009/06/17/downloads-commerce-server-upmmembershipprovider-and-dotnetnuke/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 13:59:01 +0000</pubDate>
		<dc:creator>Brandon Haynes</dc:creator>
				<category><![CDATA[DotNetNuke (DNN) Content Management System]]></category>
		<category><![CDATA[Microsoft Commerce Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Commerce Server]]></category>
		<category><![CDATA[Commerce Server 2007]]></category>
		<category><![CDATA[DotNetNuke]]></category>
		<category><![CDATA[UpmMembershipProvider]]></category>

		<guid isPermaLink="false">http://blogs.law.harvard.edu/brandonhaynes/?p=193</guid>
		<description><![CDATA[Slightly more than a year ago, I detailed the steps necessary to integrate Commerce Server 2007 &#8212; and specifically the UpmMembershipProvider membership subsystem &#8212; into the DotNetNuke web application framework.  This entry is located here: Using Commerce Server’s UpmMembershipProvider with DotNetNuke.
However, subsequent to my original posting detailing this approach, I experienced some IPR issues that required [...]]]></description>
			<content:encoded><![CDATA[<p>Slightly more than a year ago, I detailed the steps necessary to integrate <a href="http://www.microsoft.com/commerceserver">Commerce Server 2007</a> &#8212; and specifically the <a href="http://msdn.microsoft.com/en-us/library/microsoft.commerceserver.runtime.profiles.upmmembershipprovider.aspx">UpmMembershipProvider</a> membership subsystem &#8212; into the <a href="http://dotnetnuke.com">DotNetNuke web application framework</a>.  This entry is located here: <a title="Permanent link to Using Commerce Server’s UpmMembershipProvider with DotNetNuke" rel="bookmark" href="http://blogs.law.harvard.edu/brandonhaynes/2008/04/27/using-commerce-servers-upmmembershipprovider-with-dotnetnuke/">Using Commerce Server’s UpmMembershipProvider with DotNetNuke</a>.</p>
<p>However, subsequent to my original posting detailing this approach, I experienced some IPR issues that required my removing the download links to the actual assembly and source code.  While the information in the entry itself was largely sufficient to recreate this adapter, it required a reasonably significant amount of expertise to do so.  As a result, I suspect that many were unable to utilize the material therein.</p>
<p>I am pleased to announce that I have reached resolution on the relevant IPR issues that precluded my releasing the associated code, and have re-enabled the download links in the original post.  For convenience, I am also including them below.</p>
<p><span id="more-193"></span></p>
<p>For those not familiar with this project, the introduction from the original entry reads:</p>
<blockquote><p>&#8220;&#8230; [T]he UpmMembershipProvider membership provider, &#8230; is a part of Microsoft’s Commerce Server 2007 product, and is the only provider that offers interoperability with Commerce Server.  It replaces the older AuthManager functionality from Commerce Server 2002.  More importantly, it provides an implementation of the System.Web.Membership.MembershipProvider class, and may thus be used in any <a title="http://ASP. " href="http://asp.net/" target="_blank">ASP.NET</a> application that utilizes the standard membership system.  Read more about the UpmMembershipProvider in<a href="http://msdn2.microsoft.com/en-us/library/microsoft.commerceserver.runtime.profiles.upmmembershipprovider.aspx"><span>Microsoft’s MSDN documentation</span></a>.</p>
<p><a href="http://www.dotnetnuke.com/"><span>DotNetNuke</span></a> (DNN) is one such application that uses the <a title="http://ASP. " href="http://asp.net/" target="_blank">ASP.NET</a> membership system.  Because I’ve been working so much with it lately, I decided to investigate whether these two strangers might be successfully introduced — and indeed they can.  <a href="http://www.google.com/search?q=UpmMembershipProvider+DotNetNuke&amp;rls=com.microsoft:en-us&amp;ie=UTF-8&amp;oe=UTF-8&amp;startIndex=&amp;startPage=1"><span>Google</span></a> tells me that I am the only person to date who has successfully accomplished this task (not that surprising, given its relatively esoteric nature).</p></blockquote>
<h3>Attachments</h3>
<ul>
<li><a href="http://brandonhaynes.org/Downloads/UpmMembershipProvider/BrandonHaynes.Integration%20Web.Config%20for%20DNN%204.8.1.zip">Sample web.config for UpmMembershipAdapter and DotNetNuke</a></li>
<li><a href="http://brandonhaynes.org/Downloads/UpmMembershipProvider/BrandonHaynes.UpmMembershipProviderAdapter.zip">UpmMembershipProviderAdapter C# Project</a></li>
</ul>
<p>B</p>



Share on:


	<a rel="nofollow" id="digg" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Btitle%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke%26amp%3Bbodytext%3DSlightly%2520more%2520than%2520a%2520year%2520ago%252C%2520I%2520detailed%2520the%2520steps%2520necessary%2520to%2520integrate%2520Commerce%2520Server%25202007%2520--%2520and%2520specifically%2520the%2520UpmMembershipProvider%2520membership%2520subsystem%2520--%2520into%2520the%2520DotNetNuke%2520web%2520application%2520framework.%2520%25C2%25A0This%2520entry%2520is%2520located%2520here%253A%25C2%25A0Using%2520';" title="Digg"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" id="del.icio.us" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Btitle%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke%26amp%3Bnotes%3DSlightly%2520more%2520than%2520a%2520year%2520ago%252C%2520I%2520detailed%2520the%2520steps%2520necessary%2520to%2520integrate%2520Commerce%2520Server%25202007%2520--%2520and%2520specifically%2520the%2520UpmMembershipProvider%2520membership%2520subsystem%2520--%2520into%2520the%2520DotNetNuke%2520web%2520application%2520framework.%2520%25C2%25A0This%2520entry%2520is%2520located%2520here%253A%25C2%25A0Using%2520';" title="del.icio.us"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" id="facebook" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Bt%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke';" title="Facebook"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow" id="google" href="javascript:window.location='http%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26amp%3Bbkmk%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Btitle%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke%26amp%3Bannotation%3DSlightly%2520more%2520than%2520a%2520year%2520ago%252C%2520I%2520detailed%2520the%2520steps%2520necessary%2520to%2520integrate%2520Commerce%2520Server%25202007%2520--%2520and%2520specifically%2520the%2520UpmMembershipProvider%2520membership%2520subsystem%2520--%2520into%2520the%2520DotNetNuke%2520web%2520application%2520framework.%2520%25C2%25A0This%2520entry%2520is%2520located%2520here%253A%25C2%25A0Using%2520';" title="Google Bookmarks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="dotnetkicks" href="javascript:window.location='http%3A%2F%2Fwww.dotnetkicks.com%2Fkick%2F%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Btitle%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke';" title="DotNetKicks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/dotnetkicks.png" title="DotNetKicks" alt="DotNetKicks" class="sociable-hovers" /></a>
	><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow" id="stumbleupon" href="javascript:window.location='http%3A%2F%2Fwww.stumbleupon.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F%26amp%3Btitle%3DDownloads%253A%2520Commerce%2520Server%2520UpmMembershipProvider%2520and%2520DotNetNuke';" title="StumbleUpon"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" id="technorati" href="javascript:window.location='http%3A%2F%2Ftechnorati.com%2Ffaves%3Fadd%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2009%252F06%252F17%252Fdownloads-commerce-server-upmmembershipprovider-and-dotnetnuke%252F';" title="Technorati"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blogs.law.harvard.edu/brandonhaynes/2009/06/17/downloads-commerce-server-upmmembershipprovider-and-dotnetnuke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/us/</creativeCommons:license>
	</item>
		<item>
		<title>Using Commerce Server&#8217;s UpmMembershipProvider with DotNetNuke</title>
		<link>http://blogs.law.harvard.edu/brandonhaynes/2008/04/27/using-commerce-servers-upmmembershipprovider-with-dotnetnuke/</link>
		<comments>http://blogs.law.harvard.edu/brandonhaynes/2008/04/27/using-commerce-servers-upmmembershipprovider-with-dotnetnuke/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 19:04:00 +0000</pubDate>
		<dc:creator>Brandon Haynes</dc:creator>
				<category><![CDATA[DotNetNuke (DNN) Content Management System]]></category>
		<category><![CDATA[Microsoft Commerce Server]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Commerce Server]]></category>
		<category><![CDATA[Commerce Server 2007]]></category>
		<category><![CDATA[DotNetNuke]]></category>
		<category><![CDATA[UpmMembershipProvider]]></category>

		<guid isPermaLink="false">http://everysport.net/GamePlan3/Default.aspx?tabid=489&amp;EntryID=7</guid>
		<description><![CDATA[For those that are not familiar with the UpmMembershipProvider membership provider, it is a part of Microsoft&#8217;s Commerce Server 2007 product, and is the only provider that offers interoperability with Commerce Server.  It replaces the older AuthManager functionality from Commerce Server 2002.  More importantly, it provides an implementation of the System.Web.Membership.MembershipProvider class, and may thus [...]]]></description>
			<content:encoded><![CDATA[<p>For those that are not familiar with the UpmMembershipProvider membership provider, it is a part of Microsoft&#8217;s Commerce Server 2007 product, and is the only provider that offers interoperability with Commerce Server.  It replaces the older AuthManager functionality from Commerce Server 2002.  More importantly, it provides an implementation of the System.Web.Membership.MembershipProvider class, and may thus be used in any&nbsp;<a href="http://ASP.NET" title="http://ASP. " target="_blank">ASP.NET</a> application that utilizes the standard membership system.  Read more about the UpmMembershipProvider in <a href="http://msdn2.microsoft.com/en-us/library/microsoft.commerceserver.runtime.profiles.upmmembershipprovider.aspx"><span style="color: #669966">Microsoft&#8217;s MSDN documentation</span></a>.</p>
<p><a href="http://www.dotnetnuke.com/"><span style="color: #669966">DotNetNuke</span></a> (DNN) is one such application that uses the&nbsp;<a href="http://ASP.NET" title="http://ASP. " target="_blank">ASP.NET</a> membership system.  Because I&#8217;ve been working so much with it lately, I decided to investigate whether these two strangers might be successfully introduced &#8212; and indeed they can.  <a href="http://www.google.com/search?q=UpmMembershipProvider+DotNetNuke&amp;rls=com.microsoft:en-us&amp;ie=UTF-8&amp;oe=UTF-8&amp;startIndex=&amp;startPage=1"><span style="color: #669966">Google</span></a> tells me that I am the only person to date who has successfully accomplished this task (not that surprising, given its relatively esoteric nature).</p>
<p>It turns out that this integration consists of three tasks: (1) configuring Commerce Server appropriately, (2) the routine tasks that one would expect in using the new provider, (3) and a small integration <a href="http://en.wikipedia.org/wiki/Gotcha_%28programming%29"><span style="color: #669966">gotcha</span></a>.  Herein I address these in order.<span id="more-11"></span></p>
<h2>Configuring Commerce Server</h2>
<p>Commerce Server uses the GeneralInfo.email_address value of the UserObject profile object by default for authentication.  This is great, except that DotNetNuke uses a generic login name during registration.  While it&#8217;s possible to configure DNN to use e-mail addresses throughout its registration system, that&#8217;s a topic for a later date and beyond the scope of the task at hand.</p>
<p>We are thus forced to move Commerce Server away from e-mail addresses in favor of a more generic login name.  If you haven&#8217;t already configured your Commerce Server installation to use such a login name, you&#8217;ll need to do so.  Amy describes this process in her newsgroup post <a href="http://groups.google.com.sg/group/microsoft.public.commerceserver.general/msg/dae61f2735df12d2?dmode=source&amp;hl=en"><span style="color: #669966">here</span></a>.  Thanks Amy!</p>
<h2>Web.Config Integration</h2>
<p>Most developers will know that the first task in installing a new provider is updating the application&#8217;s web.config file with details about the provider.  Accordingly, we add the following to our web.config:</p>
<pre>        <span class="kwrd">&lt;</span><span class="html">membership</span> <span class="attr">defaultProvider</span><span class="kwrd">="UpmMembershipProviderAdapter"</span>
                    <span class="attr">userIsOnlineTimeWindow</span><span class="kwrd">="15"</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">providers</span><span class="kwrd">&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">clear</span><span class="kwrd">/&gt;</span>
                <span class="kwrd">&lt;</span><span class="html">add</span> <span class="attr">name</span><span class="kwrd">="UpmMembershipProviderAdapter"</span>
                     <span class="attr">enablePasswordReset</span><span class="kwrd">="true"</span>
                     <span class="attr">logonNameProperty</span><span class="kwrd">="GeneralInfo.login_name"</span>
                     <span class="attr">enableCreateDate</span><span class="kwrd">="true"</span>
                     <span class="attr">enableEmailAddress</span><span class="kwrd">="true"</span>
                     <span class="attr">enableLastLoginDate</span><span class="kwrd">="true"</span>
                     <span class="attr">profileDefinition</span><span class="kwrd">="UserObject"</span>
                     <span class="attr">requiresApproval</span><span class="kwrd">="true"</span>
                     <span class="attr">minRequiredPasswordLength</span><span class="kwrd">="5"</span>
                     <span class="attr">minRequiredNonalphanumericCharacters</span><span class="kwrd">="0"</span>
                     <span class="attr">maxInvalidPasswordAttempts</span><span class="kwrd">="5"</span>
                     <span class="attr">passwordAttemptWindows</span><span class="kwrd">="15"</span>
                     <span class="attr">passwordLockoutPeriod</span><span class="kwrd">="10"</span>
                    <span class="attr">type</span><span class="kwrd">="<strong>BrandonHaynes.Membership.UpmMembershipProviderAdapter</strong>"</span><span class="kwrd">/&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">providers</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">membership</span><span class="kwrd">&gt;</span></pre>
<p>Two comments about this entry:</p>
<ol>
<li>Most attributes are straightforward and default here, including: enablePasswordReset, loginNameProperty, enableCreateDate, enableEmailAddress, enableLastLoginDate, profileDefinition.  Note that the UpmMembershipProvider does not support many of the attributes available in the AspNetSqlMembershipProvider; see the <a href="http://msdn2.microsoft.com/en-us/library/ms917174.aspx"><span style="color: #669966">MSDN documentation</span></a> for more details.  This can be a source of frustration, as the provider does not complain when an unsupported attribute is supplied.</li>
<li>I did not directly use the UpmMembershipProvider class located in the&nbsp;<a href="http://Microsoft.Com" title="http://Microsoft. " target="_blank">Microsoft.Com</a>merceServer.Runtime assembly.  The reason for this is discussed below as a <a href="http://en.wikipedia.org/wiki/Gotcha_%28programming%29"><span style="color: #669966">gotcha</span></a>.</li>
</ol>
<p>Additionally, you&#8217;ll need to copy over all the required Commerce Server files to your DNN installation.  These can come from the StarterSite or CSharpSite (obviously this choice will impact your mappings, and any production application will likely have customized these files).  These files include:</p>
<blockquote>
<ul>
<li>All files in the pipelines subdirectory</li>
<li>bin/CommerceMessageManager.dll,</li>
<li>The de-DE, EN, en-us, fr-fr, and ja-JP subdirectories of the bin folder.</li>
<li>OrderObjectMappings.xml</li>
<li>OrderPipelineMappings.xml</li>
<li>csapp.ini</li>
</ul>
</blockquote>
<p>Naturally, the default DotNetNuke web.config must have the required Commerce Server sections added.  This includes {sectionGroup[@name = 'CommerceServer'], compilation/assemblies, system.web/httpModules, and  CommerceServer} elements.  Look to the Commerce Server SDK StarterSite for a model web.config, or use the one that I provide below.</p>
<p>That&#8217;s it with the trivial part.  Not so bad at all!</p>
<h2>Adapting the Provider</h2>
<p>As mentioned above, the UpmMembershipProvider does not support some of the configuration properties available in its MembershipProvider base class, and throws a NotSupportedException when any of these methods/properties are called.  Unfortunately, DotNetNuke makes calls to one of these unsupported properties &#8212; PasswordQuestion &#8212; regardless of the provider configuration.  Without modifying the core, there is no way to declaratively remedy this problem.</p>
<p>Because of this issue, we are forced to <a href="http://en.wikipedia.org/wiki/Decorator_pattern"><span style="color: #669966">decorate</span></a> the UpmMembershipUser object so that it does not throw, and <a href="http://en.wikipedia.org/wiki/Adapter_pattern"><span style="color: #669966">adapt</span></a> the UpmMembershipProvider such that it returns our newly decorated user objects.</p>
<h3>Decorating the UpmMembershipUser</h3>
<p>Our <a href="http://en.wikipedia.org/wiki/Decorator_pattern"><span style="color: #669966">decoration</span></a> is very straightforward and by-the-book:</p>
<pre>    <span class="kwrd">class</span> UpmMembershipUserAdapterDecorator : MembershipUser
        {
        <span class="kwrd">private</span> MembershipUser decoratedMembershipUser;

        <span class="kwrd">internal</span> UpmMembershipUserAdapterDecorator(MembershipUser decoratedMembershipUser)
            {
            <span class="kwrd">this</span>.decoratedMembershipUser = decoratedMembershipUser;
            }

        <span class="kwrd">internal</span> MembershipUser DecoratedMembershipUser
            {
            get { <span class="kwrd">return</span> decoratedMembershipUser; }
            }

        <span class="preproc">#region</span> Decorated Overrides

<strong>        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">string</span> PasswordQuestion
            {
            get
                {
                <span class="kwrd">if</span> (System.Web.Security.Membership.Providers[decoratedMembershipUser.ProviderName].RequiresQuestionAndAnswer)
                    <span class="kwrd">return</span> decoratedMembershipUser.PasswordQuestion;
                <span class="kwrd">else</span>
                    <span class="kwrd">return</span> <span class="kwrd">null</span>;
                }
            }
</strong>        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Delegated Overrides ...
        }</pre>
<p>Here we decorate the PasswordQuestion property such that it relies on base implementation when RequiresQuestionAndAnswer is activated in the web.config, and null if it is unsupported (instead of throwing).  The &#8220;Delegated Overrides&#8221; region implements the rest of the MembershipUser methods, passing the call to the decorated MembershipUser as per the pattern.</p>
<h3></h3>
<h3>Adapting the UpmMembershipProvider</h3>
<p>Next, we <a href="http://en.wikipedia.org/wiki/Adapter_pattern"><span style="color: #669966">adapt</span></a> the UpmMembershipProvider class so that it returns DecoratedMembershipUsers (instead of UpmMembershpUsers):</p>
<pre>    <span class="kwrd">public</span> <span class="kwrd">class</span> UpmMembershipProviderAdapter : UpmMembershipProvider
        {
        <span class="kwrd">public</span> UpmMembershipProviderAdapter() : <span class="kwrd">base</span>() { }

        <span class="preproc">#region</span> Overridden Functions

        <span class="kwrd">public</span> <span class="kwrd">override</span> MembershipUser CreateUser(<span class="kwrd">string</span> username, <span class="kwrd">string</span> password,
        <span class="kwrd">string</span> email, <span class="kwrd">string</span> passwordQuestion, <span class="kwrd">string</span> passwordAnswer, <span class="kwrd">bool</span> isApproved,
        <span class="kwrd">object</span> providerUserKey, <span class="kwrd">out</span> MembershipCreateStatus status)
            {
            <span class="kwrd">return</span> DecorateUser(<span class="kwrd">base</span>.CreateUser(username, password, email,
                 passwordQuestion, passwordAnswer, isApproved, providerUserKey,
                <span class="kwrd">out</span> status));
            }

        <span class="kwrd">public</span> <span class="kwrd">override</span> MembershipUser GetUser(<span class="kwrd">object</span> providerUserKey, <span class="kwrd">bool</span> userIsOnline)
            {
            <span class="kwrd">return</span> DecorateUser(<span class="kwrd">base</span>.GetUser(providerUserKey, userIsOnline));
            }

        <span class="kwrd">public</span> <span class="kwrd">override</span> MembershipUser GetUser(<span class="kwrd">string</span> username, <span class="kwrd">bool</span> userIsOnline)
            {
            <span class="kwrd">return</span> DecorateUser(<span class="kwrd">base</span>.GetUser(username, userIsOnline));
            }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> UpdateUser(MembershipUser user)
            {
            <span class="kwrd">base</span>.UpdateUser(ExtractDecoratedUser(user));
            }
        <span class="preproc">#endregion</span>

        <span class="preproc">#region</span> Private Functions

        <span class="kwrd">private</span> <span class="kwrd">static</span> MembershipUser DecorateUser(MembershipUser decoratedUser)
            {
            <span class="kwrd">if</span> (decoratedUser != <span class="kwrd">null</span>)
                decoratedUser =
                <span class="kwrd">new</span> UpmMembershipUserAdapterDecorator(decoratedUser);

            <span class="kwrd">return</span> decoratedUser;
            }

        <span class="kwrd">private</span> <span class="kwrd">static</span> MembershipUser ExtractDecoratedUser(MembershipUser user)
            {
            UpmMembershipUserAdapterDecorator decoratedUser =
                user <span class="kwrd">as</span> UpmMembershipUserAdapterDecorator;

            <span class="kwrd">if</span> (decoratedUser != <span class="kwrd">null</span>)
                user = decoratedUser.DecoratedMembershipUser;

            <span class="kwrd">return</span> user;
            }

        <span class="preproc">#endregion</span>
        }</pre>
<p>This adaptation is also very straightforward.  The methods that return MembershipUsers (CreateUser, GetUser, UpdateUser) decorate the UpmMembershipUser returned by the base implementation.  Note that I included a private ExtractDecoratedUser helper function to aid in debugging, but as it is not called internally it may be safely omitted at a developer&#8217;s discretion.</p>
<h2></h2>
<h2>Closing Comments</h2>
<p>Despite a few configuration hassles, coaxing the UpmMembershipProvider to play nicely with DotNetNuke was surprisingly easy.  I&#8217;ve made the relevant files available as a download for anyone desiring to duplicate this integration.</p>
<p>I&#8217;d appreciate feedback and comments (and of course questions!) for anyone who chooses to duplicate my efforts.  Good luck!</p>
<p>B</p>
<h3>Attachments</h3>
<ul>
<li><a href="http://brandonhaynes.org/Downloads/UpmMembershipProvider/BrandonHaynes.Integration Web.Config for DNN 4.8.1.zip">Integration Sample web.config for UpmMembershipAdapter and DotNetNuke</a></li>
<li><a href="http://brandonhaynes.org/Downloads/UpmMembershipProvider/BrandonHaynes.UpmMembershipProviderAdapter.zip">UpmMembershipProviderAdapter C# Project</a></li>
</ul>



Share on:


	<a rel="nofollow" id="digg" href="javascript:window.location='http%3A%2F%2Fdigg.com%2Fsubmit%3Fphase%3D2%26amp%3Burl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke%26amp%3Bbodytext%3DFor%2520those%2520that%2520are%2520not%2520familiar%2520with%2520the%2520UpmMembershipProvider%2520membership%2520provider%252C%2520it%2520is%2520a%2520part%2520of%2520Microsoft%2527s%2520Commerce%2520Server%25202007%2520product%252C%2520and%2520is%2520the%2520only%2520provider%2520that%2520offers%2520interoperability%2520with%2520Commerce%2520Server.%25C2%25A0%2520It%2520replaces%2520the%2520older%2520AuthMana';" title="Digg"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<a rel="nofollow" id="del.icio.us" href="javascript:window.location='http%3A%2F%2Fdelicious.com%2Fpost%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke%26amp%3Bnotes%3DFor%2520those%2520that%2520are%2520not%2520familiar%2520with%2520the%2520UpmMembershipProvider%2520membership%2520provider%252C%2520it%2520is%2520a%2520part%2520of%2520Microsoft%2527s%2520Commerce%2520Server%25202007%2520product%252C%2520and%2520is%2520the%2520only%2520provider%2520that%2520offers%2520interoperability%2520with%2520Commerce%2520Server.%25C2%25A0%2520It%2520replaces%2520the%2520older%2520AuthMana';" title="del.icio.us"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow" id="facebook" href="javascript:window.location='http%3A%2F%2Fwww.facebook.com%2Fshare.php%3Fu%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Bt%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke';" title="Facebook"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow" id="google" href="javascript:window.location='http%3A%2F%2Fwww.google.com%2Fbookmarks%2Fmark%3Fop%3Dedit%26amp%3Bbkmk%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke%26amp%3Bannotation%3DFor%2520those%2520that%2520are%2520not%2520familiar%2520with%2520the%2520UpmMembershipProvider%2520membership%2520provider%252C%2520it%2520is%2520a%2520part%2520of%2520Microsoft%2527s%2520Commerce%2520Server%25202007%2520product%252C%2520and%2520is%2520the%2520only%2520provider%2520that%2520offers%2520interoperability%2520with%2520Commerce%2520Server.%25C2%25A0%2520It%2520replaces%2520the%2520older%2520AuthMana';" title="Google Bookmarks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="dotnetkicks" href="javascript:window.location='http%3A%2F%2Fwww.dotnetkicks.com%2Fkick%2F%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke';" title="DotNetKicks"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/dotnetkicks.png" title="DotNetKicks" alt="DotNetKicks" class="sociable-hovers" /></a>
	<a rel="nofollow" id="linkedin" href="javascript:window.location='http%3A%2F%2Fwww.linkedin.com%2FshareArticle%3Fmini%3Dtrue%26amp%3Burl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke%26amp%3Bsource%3DFrom%2Bthe%2BDesk%2Bof%2BBrandon%2BHaynes%2BObservations%2Babout%2Bthe%2Bintersection%2Bof%2Btechnology%252C%2Bbusiness%252C%2Band%2Bintellectual%2Bproperty%26amp%3Bsummary%3DFor%2520those%2520that%2520are%2520not%2520familiar%2520with%2520the%2520UpmMembershipProvider%2520membership%2520provider%252C%2520it%2520is%2520a%2520part%2520of%2520Microsoft%2527s%2520Commerce%2520Server%25202007%2520product%252C%2520and%2520is%2520the%2520only%2520provider%2520that%2520offers%2520interoperability%2520with%2520Commerce%2520Server.%25C2%25A0%2520It%2520replaces%2520the%2520older%2520AuthMana';" title="LinkedIn"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a>
	<a rel="nofollow" id="stumbleupon" href="javascript:window.location='http%3A%2F%2Fwww.stumbleupon.com%2Fsubmit%3Furl%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F%26amp%3Btitle%3DUsing%2520Commerce%2520Server%2527s%2520UpmMembershipProvider%2520with%2520DotNetNuke';" title="StumbleUpon"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a>
	<a rel="nofollow" id="technorati" href="javascript:window.location='http%3A%2F%2Ftechnorati.com%2Ffaves%3Fadd%3Dhttp%253A%252F%252Fblogs.law.harvard.edu%252Fbrandonhaynes%252F2008%252F04%252F27%252Fusing-commerce-servers-upmmembershipprovider-with-dotnetnuke%252F';" title="Technorati"><img src="http://blogs.law.harvard.edu/brandonhaynes/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://blogs.law.harvard.edu/brandonhaynes/2008/04/27/using-commerce-servers-upmmembershipprovider-with-dotnetnuke/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/us/</creativeCommons:license>
	</item>
	</channel>
</rss>
