Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The idea you should follow in the case of custom membership/role providers is similar to what <a href="http://sdn5.sitecore.net/Products/AD.aspx" rel="noreferrer">AD module</a> lists in <a href="http://sdn5.sitecore.net/Products/AD/Documentation.aspx" rel="noreferrer">its setup instructions</a>. The entire process can be split into several steps:</p> <ul> <li>Adding a connection string to connectionstrings.config</li> <li>Adding membership/role provider definitions to the system.web section of web.config</li> <li>Activating switchers</li> <li>Creating a new domain for the users/roles from custom provider</li> <li>Adding domain/provider mappings</li> </ul> <h2>Adding a connection string</h2> <p>This is pretty straightforward and it seems this is what you've done already. The point is to have a connection string to the database you can then reference from the custom providers.</p> <h2>Adding membership/role provider definitions</h2> <p>Another simple step - just add a membership provider definition (<code>myProvider</code> in your case) under <code>system.web/membership/providers</code> section in web.config, and add a role provider definition under <code>system.web/roleManager/providers</code> section. The order is not important. At this point, you do not modify any other provider definitions in the mentioned sections.</p> <h2>Activating switchers</h2> <p>This is where it becomes complicated. First off, DON'T CHANGE the <code>@defaultProvider</code> attribute value. It is <code>'sitecore'</code> by default and it should stay as is. Instead, find the provider called <code>"sitecore"</code>, and change its <code>@realProviderName</code> attribute value from <code>'sql'</code> to <code>'switcher'</code>.</p> <p>The provider named "switcher" is responsible for all the magic behind switching the providers and combining the results of GetAll/Find methods.</p> <h2>Create a new domain</h2> <p>You should create a new domain for the users/role you'll take from your custom DB through your custom providers. Something like this:</p> <pre><code> &lt;domain name="myDomain" ensureAnonymousUser="false"/&gt; </code></pre> <p>The <code>@ensureAnonymousUser</code> attribute being set to false means that Sitecore won't add an anonymous user to your domain, so there won't be <code>myDomain\Anonymous</code>. This is usually the desired behavior for the custom domains.</p> <h2>Adding domain/provider mappings</h2> <p>This is the last step to let Sitecore know which domain is served with each provider. One provider can handle multiple domains (default Sitecore SQL provider stores the users from 'sitecore' and 'extranet' domains), but not vice versa.</p> <p>So, open the main web.config file and browse to the <code>configuration/sitecore/switchingProviders</code> section. Add something like this for memberhip subsection:</p> <pre><code>&lt;provider providerName="myProvider" storeFullNames="false" wildcard="%" domains="myDomain" /&gt; </code></pre> <p>and the similar thing for roleManager subsection:</p> <pre><code>&lt;provider providerName="myProvider" storeFullNames="false" wildcard="%" domains="myDomain" /&gt; </code></pre> <p>After this, the users from your DB will be visible as <code>'myDomain\user'</code> in UserManager, the same is true for roles. The <code>@storeFullNames='false'</code> means that your DB stores the users/roles without domain prefixes, just the local names. Wildcard should be the default value in case your custom source is SQL (which obviously is).</p> <p>That's it, and now it should work! :-) The details of the steps above are described in <a href="http://sdn5.sitecore.net/Articles/Security/Low_level_Sitecore_Security_and_Custom_Providers.aspx" rel="noreferrer">this article</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload