locked
Server Side Blazor + Msft Authentication (EFCore) - two databases? RRS feed

  • Question

  • User379720387 posted

    Microsoft Authentication creates EFCore functionality out of the box at fist registration. That all works for me, however that database was created in localdb.

    Very cute this is all automated and I have something to work with, BUT I have an existing db in my local SQL Server instance and eventually on a VM.

    What is the suggested approach going forward:

    work with two databases?

    migrate all the tables from the localdb to my SS local instance?

    Please advise.

    Wednesday, December 16, 2020 8:19 PM

Answers

  • User475983607 posted

    Generally, there is an integration plan when you have an existing database in play.  This plan is typically hashed out before writing any code.  

    What is the suggested approach going forward:

    work with two databases?

    It is quite common to have a separate user database.  It comes down to your requirements.  What do you want to do?

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 16, 2020 10:49 PM
  • User475983607 posted

    I have an existing database that has the tables for Simple Membership. Are there means to copy users across databases beside exporting & importing?

    If I understand correctly, you want to migrate user accounts from SimpleMemberhip to Core Identity.  I would start with the official migration docs to see if docs answer your question(s).

    https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/membership-to-core-identity?view=aspnetcore-5.0

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 17, 2020 3:03 PM
  • User-474980206 posted

    if you don't have a database to migrate, its expected that you would create a real database, and change the connect string to the new database, not use localdb.  

    because the old simple identity did not use a secure enough hash, the old passwords are not supported. you can custom code a migration when user logins, but its simpler to just require a password reset.

    you also might try reading the docs.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 17, 2020 5:02 PM

All replies

  • User475983607 posted

    Generally, there is an integration plan when you have an existing database in play.  This plan is typically hashed out before writing any code.  

    What is the suggested approach going forward:

    work with two databases?

    It is quite common to have a separate user database.  It comes down to your requirements.  What do you want to do?

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, December 16, 2020 10:49 PM
  • User379720387 posted

    I am in the pre-plan of discovery, stumbling around running into to obstacles that I am trying to solve.

    The requirements are: not lose my sanity

    Next time when I do this again I will know what to expect and I can make a plan before writing any code and I will be able to formulate some requirements related to functionality.

    I have an existing database that has the tables for Simple Membership. Are there means to copy users across databases beside exporting & importing?

    Any suggestions as to what aspects should be considered for integration?

    Thursday, December 17, 2020 2:36 PM
  • User475983607 posted

    I have an existing database that has the tables for Simple Membership. Are there means to copy users across databases beside exporting & importing?

    If I understand correctly, you want to migrate user accounts from SimpleMemberhip to Core Identity.  I would start with the official migration docs to see if docs answer your question(s).

    https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/membership-to-core-identity?view=aspnetcore-5.0

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 17, 2020 3:03 PM
  • User-474980206 posted

    if you don't have a database to migrate, its expected that you would create a real database, and change the connect string to the new database, not use localdb.  

    because the old simple identity did not use a secure enough hash, the old passwords are not supported. you can custom code a migration when user logins, but its simpler to just require a password reset.

    you also might try reading the docs.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 17, 2020 5:02 PM