I have a use case where user authentication is handled mainly through SQL Server users. When a user logs in through a WebAPI, it attempts to connect to the db using the username and password entered, if the connection is successful, the user is authenticated and further requests are also made using the entered username and password for db connections.
How can I use these details to initialize the DbContext with DI, if possible?