I have a PHP dashboard system that uses MS SQL Server and Stored Procs,
I am revamping ti to ASP.Net MVC Core , so for now I need to know how can I call the existing Login Stored Proc using ASP.Net Core Identity ?
How would I go about customizing SignInManager and UserManager to use my existing database stored procs / tables for queries?
OR If I were to create a Repository that can call my existing stored procs , how I would I get it to work with UserManager and SignInManager ?
This is my existing Login stored proc:
PROC [dbo].[AccessLogin]
@User varchar(255)
, @Password varchar(255)
, @NewPass1 varchar(255) = NULL -- Non-blank to change password
, @NewPass2 varchar(255) = NULL
, @IpAddress varchar(255) = NULL -- To allow automatic login from internal IPs (eg VPN)
, @Cookie varchar(128) = NULL
, @ResultSet bit = NULL -- Default 1
, @SessionId int = NULL OUTPUT
, @UserId int = NULL OUTPUT -- For AccessCheckSession
, @ErrorId int = NULL OUTPUT
, @ErrorMessage varchar(255) = NULL OUTPUT
, @debug int = 0
I pass in parameters fro @User/@Password/@Cookie
@Cookie, I auto-generate combination of alphanumeric string ... then i carry this cookie the entire application as it is being use by other Procs that I query
It returns the output parameters and the resultset if I set @ResultSet = 1
Please advise on how I can use this above on my ASP.Net MVC Core application using ASP.Net Core Identity ?
I use the following packages on my app:
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.2" /><PackageReference Include="Microsoft.AspNetCore.Authentication.Cookies" Version="1.1.2" /><PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="1.1.2" />