Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A good approach is to use both the Membership Provider and the Profile provider.</p> <p>The Membership provider will manage the creation of users, password validation, keeping track of who and when logs in to your app, etc.</p> <p>The Profile provider allows you to manage multiple attributes for the user.</p> <p>So, you will need to do the following:</p> <ol> <li><p>Implement your own Membership provider. See msdn.microsoft.com/en-us/library/f1kyba5e.aspx or msdn.microsoft.com/en-us/library/44w5aswa.aspx</p></li> <li><p>Implement your Profile provider (or use an existing one).<br> See here msdn.microsoft.com/en-us/library/0580x1f5.aspx or msdn.microsoft.com/en-us/library/ta63b872.aspx</p></li> <li><p>Implement a ProfileCommon class defining the attributes you want to use for your users. Your Profile provider should know how to handle the ProfileCommon class.</p></li> </ol> <p>For a ProfileCommon example I implemented the following for my custom MongoDB ASPNet Providers: github.com/agarcian/MongoDBASPNetProviders/blob/master/ASPNETProvidersForMongoDB/ProfileCommon.cs</p> <ol> <li>Configure the WebConfig sections to define your custom implementations. (See sample below)</li> </ol> <p>The next examples are part of custom Membership, Role, and Profile providers I developed for MongoDB. See <a href="https://github.com/agarcian/MongoDBASPNetProviders" rel="nofollow">https://github.com/agarcian/MongoDBASPNetProviders</a></p> <p>Here is the configuration I use in my apps to utilize my custom membership provider.</p> <pre><code>&lt;membership defaultProvider="MongoDBProvider" userIsOnlineTimeWindow="15"&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add name="MongoDBProvider" type="ASPNetProvidersForMongoDB.MongoDBMembershipProvider, ASPNetProvidersForMongoDB" connectionStringName="MongoProvidersDBConnStr" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" writeExceptionsToEventLog="true" mongoProviderDatabaseName ="aspnetproviderdb" mongoProviderUsersCollectionName="Users" applicationName="WebUI4" /&gt; &lt;/providers&gt; &lt;/membership&gt; &lt;roleManager defaultProvider="MongoDBProvider" enabled="true"&gt; &lt;providers&gt; &lt;clear /&gt; &lt;add applicationName="WebUI4" name="MongoDBProvider" type="ASPNetProvidersForMongoDB.MongoDBRolesProvider, ASPNetProvidersForMongoDB" connectionStringName="MongoProvidersDBConnStr" writeExceptionsToEventLog="true" mongoProviderDatabaseName ="aspnetproviderdb" mongoProviderUsersCollectionName="Roles" /&gt; &lt;/providers&gt; &lt;/roleManager&gt; &lt;profile defaultProvider="MongoDBProvider" inherits="MyCompany.Security.Profile.ProfileCommon"&gt; &lt;providers&gt; &lt;add applicationName="WebUI4" name="MongoDBProvider" type="ASPNetProvidersForMongoDB.MongoDBProfileProvider, ASPNetProvidersForMongoDB" connectionStringName="MongoProvidersDBConnStr" writeExceptionsToEventLog="true" mongoProviderDatabaseName ="aspnetproviderdb" mongoProviderUsersCollectionName="Profiles" /&gt; &lt;/providers&gt; &lt;/profile&gt; </code></pre> <p>I hope this helps.</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. 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