Web.Config
1.Connection Strings.
<add name="ADConnectionString"
connectionString="LDAP://server.domain.local/CN=Users,DC=domain,DC=local"/>
<add name="AzManConnectionString"
connectionString="msldap://server/CN=store,DC=domain,DC=local"/>
2.<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web,
Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="ADConnectionString"
connectionUsername="domain\Administrator" connectionPassword="pass@word1"
connectionProtection="Secure" enableSearchMethods="true"
attributeMapUsername="sAMAccountName" minRequiredPasswordLength="7"
applicationName="APP" minRequiredNonalphanumericCharacters="1"/>
</providers>
</membership>
3.<roleManager enabled="true" cacheRolesInCookie="false"
defaultProvider="RoleManagerAzManProvider" cookieTimeout="30"
cookieRequireSSL="false" cookieSlidingExpiration="false"
createPersistentCookie="false" cookieProtection="All" >
<providers>
<add name="RoleManagerAzManProvider"
type="System.Web.Security.AuthorizationStoreRoleProvider, System.Web,
Version=2.0.0.0,
Culture=neutral,
publicKeyToken=b03f5f7f11d50a3a" connectionStringName="AzManADAMServer"
applicationName="APP"/>
</providers>
</roleManager>
4.<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="Default.aspx" timeout="30"
protection="All" requireSSL="false" slidingExpiration="false"
cookieless="UseCookies"/>
</authentication>
5. <authorization>
<deny users="?"/>
</authorization>
Simple Test Page .aspx.
If User.Identity.IsAuthenticated Then
Dim rp As RolePrincipal = CType(User, RolePrincipal)
Dim roleInfo As StringBuilder = New StringBuilder
roleInfo.AppendFormat("<h2>Welcome {0}</h2>", rp.Identity.Name)
roleInfo.AppendFormat("<b>Provider:</b> {0}<BR>",
rp.ProviderName)
roleInfo.AppendFormat("<b>Version:</b> {0}<BR>", rp.Version)
roleInfo.AppendFormat("<b>Expires at:</b> {0}<BR>",
rp.ExpireDate)
roleInfo.AppendFormat("<b>Cache List Changed:</b> {0}<BR>",
rp.CachedListChanged)
roleInfo.AppendFormat("<b>Is role List Cached:</b> {0}<BR>",
rp.IsRoleListCached)
roleInfo.Append("<b>Roles:</b> ")
Dim roles() As String = rp.GetRoles
For i As Integer = 0 To roles.Length - 1
roleInfo.Append(", ")
roleInfo.Append(roles(i))
Next
Me.Label1.Text = roleInfo.ToString
End If