As promised in my comment here is our setup for enabling the Sitecore setup to stay the same while adding an extra membership provider to use in your website specifically.
First this can be found inside of our web.config transform file under the <system.web>
:
<membership hashAlgorithmType="SHA256" xdt:Transform="SetAttributes(hashAlgorithmType)">
<providers>
<add name="sitecore" type="Sitecore.Security.SitecoreMembershipProvider, Sitecore.Kernel" realProviderName="switcher" providerWildcard="%" raiseEvents="true" xdt:Locator="Match(name)" xdt:Transform="Replace" />
<add name="myprovider" type="MyProject.SecurityProviders.MembershipProvider, MyProject.SecurityProviders" applicationName="sitecore" xdt:Transform="Insert"/>
</providers>
</membership>
<roleManager>
<providers>
<add name="sitecore" type="Sitecore.Security.SitecoreRoleProvider, Sitecore.Kernel" realProviderName="switcher" raiseEvents="true" xdt:Locator="Match(name)" xdt:Transform="Replace" />
<add name="myprovider" type="MyProject.SecurityProviders.RoleProvider, MyProject.SecurityProviders" applicationName="sitecore" xdt:Transform="Insert"/>
</providers>
</roleManager>
Next this is found in a separate config include file directly under <sitecore>
:
<switchingProviders>
<membership>
<provider providerName="myprovider" storeFullNames="false" wildcard="%" domains="websitedomain" patch:before="*"/>
</membership>
<roleManager>
<provider providerName="myprovider" storeFullNames="false" wildcard="%" domains="websitedomain" patch:before="*"/>
</roleManager>
</switchingProviders>
These 2 changes in configuration will enable you to create a custom membership and role provider (in case you need one). As you can see the tricky part is not making the switching membership provider of sitecore the default provider (as stated in the documentation 2.6.2) but setting the realProviderName of the sitecore provider to switcher
.
From hereon it is straightforward implementation of ASP.NET Membership.