Copied to clipboard

Flag this post as spam?

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


  • Asif Malik 203 posts 339 karma points
    Apr 15, 2010 @ 12:51
    Asif Malik
    0

    Custom membership provider

    hi i am in the process of setting up a custom member section wihtin umbraco. This is for members and not back office users. I have a need to use the default asp.net memebrship provider. So far i have edited the webconfig, and chnaged the UmbracoMembershipProvider to

    <add name="UmbracoMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXX" connectionStringName="XXXXXXXX" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="XXXXXX" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="7" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/>

    I have also changed the defaulr role provider to

    <add name="UmbracoRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="XXXXXXXXX" applicationName="/" />

    Lastly i added in the conenction string and pointed both these providers to that (it is an external db). Now when i log into the backoffice I can see my Role (Member Group) (I have also created a test Member Type) however when i try to create a new member it gives me an error. I have checked the database and can see a new entry has been made in the cmsMember table, however i woudl have assumed this should have been made in the database specified in my custom connection string. When i try to click on this newly created user it also gives me an error. I have also notcied that when i try to go to edit the Role (Member Group) I also get an error, but it does get created in the correct database.

     

    Can someone please point me in the right direction as to what i need to do next ?

  • Aaron Powell 1708 posts 3046 karma points c-trib
    Apr 16, 2010 @ 00:43
    Aaron Powell
    0

    What's the error?

  • Asif Malik 203 posts 339 karma points
    Apr 17, 2010 @ 12:42
    Asif Malik
    0

    Hi Slace, i managed to fix the problem, it was basivally because i was redefining the umbraco providers, so i added my own and it all worked.

  • stc 72 posts 101 karma points
    Apr 21, 2010 @ 21:12
    stc
    0

    Hi Malik,

      I'm sorry to bother you but I'm trying to build my own membership provider too...

      However, I'm unclear as to how exactly...I build my dll...copy it to bin directory...add the line to web.config:

    <add name="myMembershipProvider" type="myNamespace.myMembershipProvider"/>

      Should I do anything more? It just seems that adding an asp:login control to my login page won't let me login members I should have allowed through the built myMembershipProvider.dll?! Plz help :)

  • stc 72 posts 101 karma points
    Apr 21, 2010 @ 21:18
    stc
    0

    Forgot to add my dll has one myMembershipProvider class overriding all membership provider methods throwing NotImplementedExceptions...except the ValidateUser that works with my separate DB containing preexisting usernames/passwords...should I of implemented anything more?

  • Asif Malik 203 posts 339 karma points
    Apr 30, 2010 @ 14:28
    Asif Malik
    0

    make sure you set the default provider to your provider

  • stc 72 posts 101 karma points
    May 01, 2010 @ 08:50
    stc
    0

    Thanks Malik,

      I actually figured that one out, but got stuck with an even bigger problem, though once again thanks for helping.

      If I could only figure out why in the logged in event (which occurs after logging in, during which my provider's validateuser is successfully called) on my asp:login control won't let me access the currently logged in user with System.Web.Security.Membership.GetUser(); as per this wiki (it alway returns me null - throws an exception)...tia

  • Asif Malik 203 posts 339 karma points
    May 04, 2010 @ 10:13
    Asif Malik
    0

    you might want to try the overload method where by you send the of GetUser, where you send it the email address (or username) of the uiser who successfully managed ot login.

Please Sign in or register to post replies

Write your reply to:

Draft