- SiteAdmin CMS - Ultimate modular Content Management System for ASP.NET
- NetPass - Membership and Role Provider
|
Configuring NetPass
ASP.NET Membership is configured using the membership element in the Web.config file for your application. The membership element is a sub-element of the system.web section. You can enable ASP.NET Membership for an application by directly editing the Web.config file for that application, or you can use the Web Site Administration Tool, which provides a wizard-based interface. As part of membership configuration, you specify:
- Which membership provider (or providers) to use. (This typically also specifies what database to store membership information in.)
- Password options such as encryption and whether to support password recovery based on a user-specific question.
- Users and passwords. If you are using the Web Site Administration Tool, you can create and manage users directly. Otherwise, you must call membership functions to create and manage users programmatically.
Web.config sample
<connectionStrings>
<add name="NetPassServices" connectionString="DRIVER={SQL Native Client}; ... />
</connectionStrings>
<roleManager defaultProvider="NetPassRoleProvider"
enabled="true"
cacheRolesInCookie="true"
cookieName=".ASPROLES"
cookieTimeout="30"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="All" >
<providers>
<clear />
<add
name="NetPassRoleProvider"
type="WDK.CommunityServices.NetPass.NetPassRoleProvider"
connectionStringName="NetPassServices"
applicationName="NetPass"
writeExceptionsToEventLog="false" />
</providers>
</roleManager>
<membership defaultProvider="NetPassMembershipProvider" userIsOnlineTimeWindow="15">
<providers>
<clear />
<add
applicationName="NetPass"
name="NetPassMembershipProvider"
type="WDK.CommunityServices.NetPass.NetPassMembershipProvider"
connectionStringName="NetPassServices"
passwordFormat="Clear"
enablePasswordRetrieval="true"
enablePasswordReset="true"
requiresQuestionAndAnswer="true"
writeExceptionsToEventLog="true" />
</providers>
</membership>
|