I would like to use the secure SqlCredential object to handle credentials for connecting to our SQL database.
.NET has an overload of the SqlConnection constructor that takes a connection string and SqlCredential so you don't have to embed the credentials in the connection string itself. I would like to use something similar for Entity Framework when creating a DBContext instance.
- I need to control the connection string that gets used by Entity Framework for the connection.
- I would like to use the more secure way of handling credentials, using either SQLCredential, NetworkCredential, or SecureString and passing that to the DBContext to create the connection.
Is there any way to do this?
(As an aside, we can't use Windows integrated security as our database is not set up for that and I am not in a position to change that.)