Last post Feb 26, 2020 11:39 PM by Norkle
Feb 26, 2020 06:42 PM|Norkle|LINK
I have an MVC 5 project that was already pre-configured acquiring by download, with Individual User Account mode in the template. I get an error when trying to register a new user, or logging in (i already have the existing table AspNetUsers in my sql server
database, which is remote on a shared host). getting System.Data.SqlClient.SqlException: The target principal name is incorrect. Cannot generate SSPI context Server error, pointing to my accountcontroller on the bolded line
public async Task<ActionResult> Login(LoginViewModel model, string returnUrl)
var user = await UserManager.FindByEmailAsync(model.Email);
The web.config connection:
<add name="DefaultConnection" connectionString="Data Source=myserver.net; User id=myuserid; password=1234;Database=mydbase;Integrated Security=True"
the consensus of answers so far online seem to center around the service account used by sql server, but again it's on a shared host and have never encountered this error.
thanks in advance
Feb 26, 2020 06:55 PM|mgebhard|LINK
Integrated security is for Windows login. It look like you are using SQL login.
Use Visual Studio's SQL Server Object Explorer or Server Explorer to create a SQL connection to your SQL server. Then copy the connection string found in the properties window.
Feb 26, 2020 11:39 PM|Norkle|LINK
Thanks m, and yes comes in handy to draft connection string via SQL Object Explorer.