Try our conversational search powered by Generative AI!

Should authentication tables of CMS and Commerce be on the same database?


I am working on the top of Alloy which has  edit-mode authentication in CMS database. I have added commerce to it and my user authentication is in commerce database. I want to keep a single login page for CMS and front end. Should I move the identity tables to CMS? What is the best approach for it?

When I changed the database to CMS, I'm getting model compatibility error.

Model compatibility cannot be checked because the database does not contain model metadata. Model compatibility can only be checked for databases created using Code First or Code First Migrations.

Edited, Apr 03, 2019 9:39

I don't think you can move the tables, but Commerce can use the "membership provider" from CMS, as long as you have the right configuration, for example in your Startup:

app.AddCmsAspNetIdentity<SiteUser>(new ApplicationOptions
ConnectionStringName = _connectionStringHandler.Cms.Name

this is assuming you are using Aspnetidentity. The configuration for ASP.NET Membership is in web.config

Apr 03, 2019 10:49
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.