I'd like to implement a "fake" Mixed Authentication using ASP.NET Core Identity and Individual User Accounts as the underlying authorization method.
The process should be like that:
- database User table is populated with all employees (i.e. Username is John.Smith or Jane.Smith)
- user opens the Intranet app which is deployed on IIS with Windows Authentication enabled
- user is authenticated upon AD and its username is DOMAIN\John.Smith
- system does another authentication upon database data using John.Smith as a login without password
- system issues a new authentication ticket for John.Smith with all its roles and claims fetched from the database
I'm stuck at point 4, where should I do that "fake" authentication?
You doesn't need to start a new authentication and issue a new ticket , you can keep using the ticket/principle authenticated from windows authentication , you can use
IClaimsTransformationto associate your current windows authentication user with local database user :In
IClaimsTransformation,after windows authentication , you can check/create a local user in your database with windows user's id/name , add id which identify local user in database to ClaimsPrincipal , so that next time you can use that claim to identify local database user when performing user management .