Hi Team,
I am working on an intranet where I implemented a custom role provider to handle all security management for our applications.
An example would be I have 5 different web applications that reference a common DLL which has the custom role provider class. My problem is that the ApplicationName setting in the webconfig of my web applications is not being passed in to my role provider class so I am getting inconsistent roles/users value from my provider.
Consuming Web Application setting
<membership defaultProvider="SqlProvider">
<providers>
<clear/>
<add name="SqlProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="HillsdaleFrameworkEntities" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Hashed"
minRequiredNonalphanumericCharacters="0" minRequiredPasswordLength="8" applicationName="MVCTemplate"/>
</providers>
</membership>
<roleManager enabled="true" defaultProvider="HillsdaleRoleProvider">
<providers>
<clear/>
<add name="HillsdaleRoleProvider" type="HDFCommonUpgraded.Model.HillsdaleRoleProvider" connectionStringName="HillsdaleFrameworkEntities" applicationName="MVCTemplate"/>
</providers>
</roleManager>
Provider class
class HillsdaleRoleProvider : RoleProvider
{
.... ommitted.....
public override string ApplicationName { get; set; } - this returns NULL? WHY? It should come from the webconfig setting ApplicationName?
}