Copied to clipboard

Flag this post as spam?

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


  • Wade Kallhoff 4 posts 71 karma points
    Jul 04, 2012 @ 03:23
    Wade Kallhoff
    0

    Custom Membership Provider

    Greetings!

    I am attempting to implement a custom membership provider for my Umbraco instance. I've created the class (based off of UmbracoMembershipProvider), and updated the config accordingly to use the new membership provider. I know this is working because it is hitting the overridden methods correctly (like ValidateUser). However, it appears that the Members section of the back office is not functioning (just a rotating loading image under Members). Through some debugging, I determined this is because it was having issues loading the Member Types section of the tree.

    After reading this forum post (from the old forum), it indicated that there is something tied to the original UmbracoMembershipProvider name that makes the Members section "work". I made the changes, set the type to my membership provider, and ran it and found out that there is something in the Initialize() method of UmbracoMembershipProvider that allows the tree to load "correctly", but unfortunately, must contain the code that points it to the Umbraco members table and not mine. Can anyone shed any light on this?

    tl:dr - Has anyone successfully implemented a custom membership provider while maintaining the functionality of the members section of the back office?

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Jul 04, 2012 @ 10:35
    Richard Soeteman
    0

    Hi,

    The member section in backend only works with the default membership (UmbracoMembershipProvider ) provider. You should be able to see members and membergroups, but editing is not supported. I think the backend uses the search method to list the members, but if you have a look at the umbracolog table you should be able to see the exception that is thrown.

     In a future version of Umbraco it will be possible to update mebers  (I think) but for now if you want to edit the members you should write something to update the members.

    Youy can use a custom membership provider also to protect content.

    Hope this helps you a bit,

    Richard

  • Michael Latouche 504 posts 819 karma points MVP 4x c-trib
    Jul 04, 2012 @ 11:16
    Michael Latouche
    0

    Hi Wade,

    I have never tried it, but I normally you should be able to use your custom provider on the front-end, and keep working with the default provider on the backend. What you need to do is get back to the default provider settings, and then add an entry for your custom provider with a specific name.

    Then, in the front-end controls etc. where you need use your custom provider, you can get your custom provider with the following command:

    var myProvider = System.Web.Security.Membership.Providers["myProviderName"];

    and then perform whatever Membership operation you need, using that specific provider.

    EDIT: On the ASP.Net controls (<asp:Login etc.), I think you can actually specify the provider name as a control property, so no codebehind needed in that case.

    Hope this helps.

    Cheers,

    Michael.

Please Sign in or register to post replies

Write your reply to:

Draft