Copied to clipboard

Flag this post as spam?

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


  • James Crane 34 posts 80 karma points
    Aug 05, 2009 @ 11:12
    James Crane
    0

    Using MySQLMembershipProvider with Umbraco

    Hi,

    I posted here earlier about how to implement the Umbraco membership provider and had some very helpful advice: http://our.umbraco.org/forum/developers/extending-umbraco/3347-Umbraco-Membership.

    However, I'm still struggling to implement the MySQLMembershipProvider. I have updated the web.config file with the relevent sections and in visual studio opened the ASP.NET configuration page. On the security tab the provider is set to MySQLMembershipProvider as expected and when I create a user via this interface the membership tables where automatically created as expected (autogenerateschema="true") and the user successfully created.

    However, when I open my umbraco solution I get this error:

    Unable to initialize provider.  Missing or incorrect schema.


    Parser Error Message: Unable to initialize provider.  Missing or incorrect schema.

    Source Error: 

    Line 157:           <clear/>
    Line 158: <add name="MySQLRoleProvider"
    Line 159: type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=5.2.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
    Line 160: connectionStringName="LocalMySqlServer"
    Line 161: applicationName="site1"/>

    I know that the web.config is setup correctly and the db connection fine otherwise I wouldn't have been able to use the ASP.NET configuration page to create a user - so is there something else I have to do to make this work in Umbraco?

    Thanks for any advice.

    JC

  • James Crane 34 posts 80 karma points
    Aug 05, 2009 @ 11:33
    James Crane
    0

    UPDATE!

    OK - my fault, I commented out the Umbraco provider references in web.config and replaced with the mysqlmembership. BOTH should be detailed thus:

     

    <membership defaultProvider="MySQLMembershipProvider">
              <providers>
                  <clear/>
                  <add name="MySQLMembershipProvider" 
                       autogenerateschema="true"
                       type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=5.2.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
                       applicationName="site1"
                       connectionStringName="LocalMySqlServer"
                       enablePasswordRetrieval="true"
                       enablePasswordReset="true"
                       requiresQuestionAndAnswer="true"
                       requiresUniqueEmail="true"
                       passwordFormat="Clear"
                       maxInvalidPasswordAttempts="5"
                       minRequiredPasswordLength="5"
                       minRequiredNonalphanumericCharacters="0"
                       passwordAttemptWindow="10"
                       passwordStrengthRegularExpression=""/>
                  <add name="UmbracoMembershipProvider"
                       type="umbraco.providers.members.UmbracoMembershipProvider"
                       enablePasswordRetrieval="false"
                       enablePasswordReset="false"
                       requiresQuestionAndAnswer="false"
                       defaultMemberTypeAlias="Another Type"
                       passwordFormat="Hashed" />
                  <add name="UsersMembershipProvider"
                       type="umbraco.providers.UsersMembershipProvider"
                       enablePasswordRetrieval="false"
                       enablePasswordReset="false"
                       requiresQuestionAndAnswer="false"
                       passwordFormat="Hashed" />
              </providers>
          </membership>

     

    <roleManager enabled="true" defaultProvider="MySQLRoleProvider" cookieName="site1"  >
              <providers>
                  <clear/>
                  <add name="MySQLRoleProvider"
                type="MySql.Web.Security.MySQLRoleProvider, MySql.Web, Version=5.2.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"
               connectionStringName="LocalMySqlServer"
               applicationName="site1"/>
                  <add
                      name="UmbracoRoleProvider"
                      type="umbraco.providers.members.UmbracoRoleProvider" />
              </providers>
          </roleManager>

     

    (no comments please about that being obvious! :-).

     

    However, I have noticed in Umbraco members section I now only have Members and Roles, member types has dissappeared. Is this becuase it's not implemented by the MySQLmembershipprovider?

     

    Thanks

    JC

     

Please Sign in or register to post replies

Write your reply to:

Draft