locked
Membership Roles in ASP.Net with MySQL RRS feed

  • Question

  • First of all, I apologize if I don't use the correct terminology...I'm not very well versed in technical terminology. 

    I built a site years ago that connects to a MySQL DB through my web host and queries the database and tables using the MySQL ODBC 3.51 Driver. However, I am interested in implementing membership roles to try to create a more secure and structured web site. I really have no idea what is involved in setting this up and what code needs to be implemented to make all of this run. 

    From what I have read and understand, I believe (correct me if I'm wrong) that I need to set up a MySQL Membership Provider with .NET or the ADO.NET driver for MySQL? I also believe I need to set up the MySQL Profile Provider and the MySQL Role Provider?

    I believe that all of this is different than the current MySQL ODBC 3.51 Driver I currently have installed and the the Membership Provider is what will be required to set up to have all the rolls I'm looking for. 

    Again, please correct me if I'm off on this. 

    Anyways, I'm asking for guidance in: 
    1) What do I need to do to set up my MySQL database with membership roles? 
    2) What connectors do I need and how do I need to set them up? 
    3) What resources are available that could walk me through step by step on how to accomplish this? 

    4) Since I have designed the site around MySQL I would obviously prefer to keep using it, but if I need to take a different path please let me know.

    Again, I'm not very well technically versed, so any specific resources or "how to's" I would really appreciate.

    I really appreciate all the help. 

    Thank you, 

    Ryan

    Wednesday, July 23, 2014 2:28 AM

Answers

  • Hi Ryan,

    Welcome to Lightswitch forum.

    In LightSwitch forum, I discuss relevant issue about Visual Studio LightSwitch. If you have any questions about asp.net, you could get help from asp.net forum, asp.net experts can help you there. 

    If you want to ASP.NET membership/role providers for MySQL, follow the steps below:

    • Add reference to MySql.Web.dll
    • Change your <membership> in web.config to this:

    <membership defaultProvider="MySqlMembershipProvider">
      <providers>
        <clear/>
        <add name="MySqlMembershipProvider"
             type="MySql.Web.Security.MySQLMembershipProvider,
                   MySql.Web, Version=6.2.2.0, Culture=neutral,
                   PublicKeyToken=c5687fc88969c44d"
             autogenerateschema="true"
             connectionStringName="NAME_OF_YOUR_CONN_STRING"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="6"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression=""
             applicationName="/"
         />
      </providers>
    </membership>

    note: you need modify MySQL version.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Angie Xu Wednesday, July 30, 2014 6:21 AM
    Friday, July 25, 2014 7:22 AM
  • Ryan,

    If developing the provider for mysql is not your cup of tea you could consider using a sql db on azure simply for the security tables. By doing so, you keep your data on primise in your mysql db. You can even use the same sql azure db for multiple apps.


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    • Marked as answer by Angie Xu Wednesday, July 30, 2014 6:21 AM
    Friday, July 25, 2014 7:35 AM

All replies

  • Hi Ryan,

    Welcome to Lightswitch forum.

    In LightSwitch forum, I discuss relevant issue about Visual Studio LightSwitch. If you have any questions about asp.net, you could get help from asp.net forum, asp.net experts can help you there. 

    If you want to ASP.NET membership/role providers for MySQL, follow the steps below:

    • Add reference to MySql.Web.dll
    • Change your <membership> in web.config to this:

    <membership defaultProvider="MySqlMembershipProvider">
      <providers>
        <clear/>
        <add name="MySqlMembershipProvider"
             type="MySql.Web.Security.MySQLMembershipProvider,
                   MySql.Web, Version=6.2.2.0, Culture=neutral,
                   PublicKeyToken=c5687fc88969c44d"
             autogenerateschema="true"
             connectionStringName="NAME_OF_YOUR_CONN_STRING"
             enablePasswordRetrieval="false"
             enablePasswordReset="true"
             requiresQuestionAndAnswer="false"
             requiresUniqueEmail="false"
             passwordFormat="Hashed"
             maxInvalidPasswordAttempts="5"
             minRequiredPasswordLength="6"
             minRequiredNonalphanumericCharacters="0"
             passwordAttemptWindow="10"
             passwordStrengthRegularExpression=""
             applicationName="/"
         />
      </providers>
    </membership>

    note: you need modify MySQL version.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Angie Xu Wednesday, July 30, 2014 6:21 AM
    Friday, July 25, 2014 7:22 AM
  • Ryan,

    If developing the provider for mysql is not your cup of tea you could consider using a sql db on azure simply for the security tables. By doing so, you keep your data on primise in your mysql db. You can even use the same sql azure db for multiple apps.


    paul van bladel ==independent enterprise application architect== http://blog.pragmaswitch.com

    • Marked as answer by Angie Xu Wednesday, July 30, 2014 6:21 AM
    Friday, July 25, 2014 7:35 AM
  • Sorry for the late response.  Thank you very much for the reply.

    Sorry about the post in this topic area, didn't realize I posted it here and not sure how I get on this topic.

    I will have to dig into this to determine if it gets me everything I need.

    I really appreciate your time.

    Thank you.

    Tuesday, July 29, 2014 11:28 AM
  • Sorry for the late response.  Thank you very much for the reply.

    That's a good idea.  I will have to explore if that will be a possibility.

    I really appreciate your time.

    Thank you.

    Tuesday, July 29, 2014 11:28 AM