1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Using custom role, memnership and profile providers

Using custom role, memnership and profile providers

6 posts, 0 answered
  1. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    02 Nov 2007
    Link to this post
    I've just intergrated (modified web.config, copied .dlls into Bin folder, etc) my custom role, membership and profile providers into sitefinity.  I'm able to login to the admin site without issue, BUT am unable to access any of the admin sections (Files, Pages, Administration and Modules).  I've tried modifying the <security> section and add some roles...to no avail.

    Any suggestions?

    Thanks!
    J
  2. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    05 Nov 2007
    Link to this post
    Hi moodie,

    If you are sure that a role exists in your role provider, if you add this role in the security section with unrestricted permissions, users from this role will have permissions for everything in the CMS. I assume you are using Sitefinity 3.0 SP2, that is why you are able to see the dashboard, in Sitefinity 3.1 you would get a 403 exception. 

    I have two suggestions about your issue.

    First (and most probable) is that you have changed only the default membership and role providers so actually Sitefinity is not using them. To change the cms providers, you have to make  the following changes to the web.config:

    Change the cmsProvidersName to the name of your providers (they should have equal names), also change the mambership and role provider's name.
    <telerik> 
      ...  
      <security defaultProvider="DefaultSecurityProvider" cmsProvidersName="YourProvider">  
        ...  
        <providers> 
          <clear/> 
          <add name="DefaultSecurityProvider"   
               connectionStringName="DefaultConnection"   
               type="Telerik.Security.Data.DefaultSecurityProvider, Telerik.Security.Data" 
               membershipProvider="YourProvider" 
               roleProvider="YourProvider"/>  
        </providers> 
      </security  
      ...  
    </telerik> 


    My second suggestion is that the user you are authenticating with is not a member of a role that has unrestricted permissions.

    If these suggestions don't help, please contact us again and we'll further investigate.

    Regards,
    Yasen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    05 Nov 2007
    Link to this post
    Thanks for the quick reply Yasen.

    I've already set these value in my Web.config and have set the approriate roles with Unrestricted access (please see section from web.config at the end of this post).

    I do seem to be to login with all the accounts set up with my Cis provider...I just can't seem to access the admin sections.  BTW.  I also noticed that I can't see the entire admin site when I set PublicUsers access to Unrestricted.

    <security defaultProvider="DefaultSecurityProvider" cmsProvidersName="CisProfileProvider">
    <
    roles>
    <
    clear/>
    <
    add name="Administrators" permission="Unrestricted"/>
    <
    add name="cem" permission="Unrestricted"/>
    <
    add name="All" permission="Unrestricted"/>
    <
    add name="all" permission="Unrestricted"/>
    <
    add name="ALL" permission="Unrestricted"/>
    <
    add name="CEM" permission="Unrestricted"/>
    <
    add name=moodie@myemail.ca permission="Unrestricted"/>
    <
    add name="PublicUsers" permission="None"/>
    </
    roles>
    <
    providers>
    <
    clear/>
    <
    add name="DefaultSecurityProvider" connectionStringName="DefaultConnection" type="Telerik.Security.DefaultSecurityProvider, Telerik.Security" membershipProvider="CisMembershipProvider" roleProvider="CisRoleProvider"/>
    </providers>
    </
    security>

    Thanks for your help!
  4. Yasen
    Yasen avatar
    121 posts
    Registered:
    18 May 2013
    06 Nov 2007
    Link to this post
    Hi moodie,

    Could you please try naming the Role and Membership providers CisProvider? I am sorry I was not aware that the providers should be named equally.

    The profile provider is not related with authentication and authorization, thus it should not be mentioned in the <security> section. The CmsProvidersName property sets the membership and role providers used by the UserManager class (the class that manages users and roles in Sitefinity), while the membershipProvider and roleProvider properties in the default security provider set the providers used in the SecurityManager class (the class that manages permissions in Sitefinity).

    To summarize, in order to have it all working properly, you have to set the cmsProvidersName, membershipProvider and roleProvider's values to the same string (i.e. "CisProvider").

    All the best,
    Yasen
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    06 Nov 2007
    Link to this post

    Getting there... :-)

    I do get some errors, but am able to access sections of the site when the accounts role is set in the security provider.  I can view the different tabs, but seem to have issues on pages that rely on my profile info (Dashboard and Adminstration - see error below).  Where would I find documentation for implementing this?

    ******Dashboard******

    The method or operation is not implemented.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Exception: The method or operation is not implemented.

    Source Error:

    Line 155:				inTrayInfo.SortDirection = System.ComponentModel.ListSortDirection.Descending;
    Line 156:				dbbUsers.DataSource = inTrayInfo.GetAsDataSource();
    Line 157:				dbbUsers.DataBind();
    Line 158:			}
    Line 159:			else

    Source File: c:\Program Files\telerik\Sitefinity3.0\WebSites\CBoC CMS\Sitefinity\Admin\Default.aspx.cs    Line: 157


    ******Administration******

    Object reference not set to an instance of an object.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

  6. Jason M
    Jason M avatar
    108 posts
    Registered:
    15 Jan 2007
    06 Nov 2007
    Link to this post
    Sorry...I just noticed that this error was for my membership and role provider!  Thanks for all your help!
Register for webinar
6 posts, 0 answered