title: SiteCore .Net Membership example
body: <p>I have been working with SiteCore 7 for about a month or less.</p>
  
  <p>I am unable to set up a .Net Membership provider from an external database in it.</p>
  
  <p>This is what my class looks like:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using System.Web;
  using System.Web.Security;
  
  namespace MProvider
  {
      public abstract class MemberProvider : MembershipProvider
      {
          public override void Initialize(string name,        System.Collections.Specialized.NameValueCollection config)
      {
          base.Initialize(name, config);
      }
  
      public override MembershipUser GetUser(object providerUserKey, bool userIsOnline)
      {
          throw new NotImplementedException();
      }
  
      public override bool ValidateUser(string username, string password)
      {
          throw new NotImplementedException();
      }
  }
  }
  }
  </code></pre>
  
  <p>This is the web.config in SiteCore</p>
  
  <pre><code>&lt;switchingProviders&gt;
        &lt;membership&gt;
          &lt;provider providerName="sql" storeFullNames="true" wildcard="%" domains="*"/&gt;
          &lt;provider providerName="MProvider" storeFullNames="true" wildcard="%"     domains="*"/&gt;
  
      &lt;membership defaultProvider="sitecore" hashAlgorithmType="SHA1"&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
          &lt;add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider,     Sitecore.Kernel" realProviderName="MProvider" providerWildcard="%" raiseEvents="true"/&gt;
          &lt;add name="sql" type="System.Web.Security.SqlMembershipProvider"   connectionStringName="core" applicationName="sitecore" minRequiredPasswordLength="1"   minRequiredNonalphanumericCharacters="0" requiresQuestionAndAnswer="false"   requiresUniqueEmail="false" maxInvalidPasswordAttempts="256"/&gt;
          &lt;add name="MProvider"  type="Sitecore.Security.SitecoreMembershipProvider"   realProviderName="MProvider"
          applicationName="sitecore" minRequiredPasswordLength="1"
          minRequiredNonalphanumericCharacters="0"&gt;&lt;/add&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;}
  </code></pre>
  
  <p>My questions are:  </p>
  
  <ol>
  <li>has anyone ever worked with a .Net Membership Provider in SiteCore?
  a. if so, what am I doing wrong?</li>
  <li>does anyone know of a working example of a .Net Membership in SiteCore?</li>
  </ol>
  
  <p>Much appreciated !</p>
  
  <p>Dave</p>