Created
November 17, 2013 02:34
-
-
Save sjwaight/7508374 to your computer and use it in GitHub Desktop.
Sample web.config for a basic forms based authentication web application that is using membership and role providers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<configuration> | |
<appSettings /> | |
<connectionStrings> | |
<!-- you'll need to change this to match your server - the one below is using the default local instance with Windows Auth. --> | |
<add name="aspnetmembers" connectionString="server=.;initial catalog=AuthDemoApp;Integrated Security=SSPI"/> | |
</connectionStrings> | |
<system.web> | |
<compilation debug="true"/> | |
<authentication mode="Forms"> | |
<forms loginUrl="Login.aspx" defaultUrl="~/Secured/Default.aspx" requireSSL="true" /> | |
</authentication> | |
<membership defaultProvider="SqlProvider"> | |
<providers> | |
<add name="SqlProvider" | |
type="System.Web.Security.SqlMembershipProvider" | |
connectionStringName="aspnetmembers" | |
applicationName="AuthDemoApp" | |
minRequiredPasswordLength="5" | |
minRequiredNonalphanumericCharacters="0" /> | |
</providers> | |
</membership> | |
<roleManager defaultProvider="SqlProvider" | |
enabled="true" | |
cacheRolesInCookie="true" | |
cookieName=".ASPROLES" | |
cookieTimeout="30" | |
cookiePath="/" | |
cookieRequireSSL="true" | |
cookieSlidingExpiration="true" | |
cookieProtection="All"> | |
<providers> | |
<add name="SqlProvider" | |
type="System.Web.Security.SqlRoleProvider" | |
connectionStringName="aspnetmembers" | |
applicationName="AuthDemoApp" /> | |
</providers> | |
</roleManager> | |
</system.web> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment