I've built an intranet hosted MVC/EF/C# application that uses windows authentication and identity impersonation and connects to SQL server using integrated security. The EF connection string looks like:
<add name="BgEntities" connectionString="metadata=res://*/Models.Bg.csdl|res://*/Models.Bg.ssdl|res://*/Models.Bg.msl;provider=System.Data.SqlClient;provider connection string="data source=xxxxxxxx;initial catalog=Bg_Dev;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
This is great for regular app users. I now need to open a controller up to all users on the intranet, but I can't add everyone in the company as users to the database. I'd like to use a generic SQL Server login to access the database from this controller. Can I switch connection strings in this controller?