Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Apr 08, 2013 @ 10:32
    Bo Damgaard Mortensen
    1

    Custom membership/role provider

    Hi all,

    I'm currently building a website which gets all member data from an external CRM by WCF services. I then want the users from the CRM to be able to log in on the site and edit their details. Also, I still want the administrators of Umbraco to be able to set up role protection on nodes which can be accessed when a CRM user has logged in.

    Is there any way to do this? :-) I tried implementing the UmbracoMembershipProvider overriding the auth method which seems to work fine. The auth cookie is placed as it should. But when it comes to the whole Role protection thing, I'm a bit stuck.

    Any help and/or hint on this is greatly appreciated!

    Thanks a lot in advance.

    - Bo

  • Jesper Hauge 298 posts 487 karma points c-trib
    Apr 08, 2013 @ 10:58
    Jesper Hauge
    0

    Off the top of my head: I think you need to implement a roleprovider also? If you check into your web.config file you'll find the following line

    <roleManager enabled="true" defaultProvider="UmbracoRoleProvider">
      <providers>
        <clear />
        <add name="UmbracoRoleProvider" type="umbraco.providers.members.UmbracoRoleProvider" />
      </providers>
    </roleManager>

    Not entirely sure, but I think you need this to assign access rights to pages.

    Regards
    Jesper 

     

     

     

     

     

     

  • Bo Damgaard Mortensen 719 posts 1207 karma points
    Apr 08, 2013 @ 11:00
    Bo Damgaard Mortensen
    0

    Hi Jesper,

    Thanks for your help :-)

    Alright'y, I was going to implement the RoleProvider class, but was not sure if you then would be able to use the "Public Access"-function in the Umbraco content tree. I'll give it a spin ;-)

    Thanks again!

     Bo

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Apr 08, 2013 @ 11:01
    Dave Woestenborghs
    0

    Here is some more info on how to keep the backend working : 

    http://our.umbraco.org/forum/developers/extending-umbraco/32984-Custom-Membership-Provider

  • Sahan Rodrigo 25 posts 97 karma points
    Apr 09, 2013 @ 10:17
    Sahan Rodrigo
    0

    Hi Bo,

    Yes, you will be able use "Public Access" to protect your pages either way (I have achieved this by overriding both). If you are not storing member data in Umbraco, you need to override both Provider's as listed below.

    1. umbraco.providers.members.UmbracoMembershipProvider
    2. umbraco.providers.members.UmbracoRoleProvider
    Also you may have to override "GetUser" method of the "UmbracoMembershipProvider" in order to get loggedIn user. Please check below link for more details. 
    Hope this helps,
    Sahan
Please Sign in or register to post replies

Write your reply to:

Draft