ASPX templates
Version 7.x > ASPX templates > User Role issue in asp.net application while using Kentico CMS Authentication dll methods View modes: 
User avatar
Member
Member
AK - 9/21/2012 7:47:53 AM
   
User Role issue in asp.net application while using Kentico CMS Authentication dll methods
Hi,

Hi,

I have implemented the Kentico CMS.MembershipProvider.CMSMembershipProvider & RoleProvider for authenticating the user in my asp.net application successfully.
This is my web.config setting
-- Connection string--
<connectionStrings>
<add name="CMSConnectionString" connectionString="Persist Security Info=False;database=COTS_Kentico;server=rxdotnet;user id=dotnet;password=dotnet;Current Language=English;Connection Timeout=240;" />
</connectionStrings>

--App Setting--
<appSettings>
<add key="CMSProgrammingLanguage" value="C#"/>

<add key="CMSApplicationGuid" value="8B01C719-6AAF-4596-9BD8-53EBBB3C74CA"/>
<add key="CMSApplicationName" value="Goodstart"/>
</appSettings>


The problem is that i'm unable to find the role of the user. Below is my membership & role provider setting

<membership defaultProvider="CMSProvider" userIsOnlineTimeWindow="30">
<providers>
<clear/>
<add name="CMSProvider" type="CMS.MembershipProvider.CMSMembershipProvider" connectionStringName="CMSConnectionString" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="true" passwordFormat="Hashed"/>
</providers>
</membership>
<roleManager defaultProvider="CMSRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
<providers>
<clear/>
<add name="CMSRoleProvider" type="CMS.MembershipProvider.CMSRoleProvider" connectionStringName="CMSConnectionString" applicationName="Goodstart" writeExceptionsToEventLog="false"/>
</providers>
</roleManager>

The code CMS.CMSHelper.CMSContext.CurrentSite.SiteName will not provide me the current site name which is obvious ,cos i'm running my sample asp.net application rather than Kentico application.

How I'm I supposed to find the role..??

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 9/21/2012 8:00:24 AM
   
RE:User Role issue in asp.net application while using Kentico CMS Authentication dll methods
Hello,

Please don't post your question multiple times. This can result into a forum ban. Your question will be answered in this thread.

Best regards,
Boris Pocatko