What we're trying to do is use Forms Authentication on a website. The user name and password are hit against Active Directory. If that returns a user then we set the formsAuthentication AuthCookie for that user name. We'd like to use that users active directory to connect to sql server.
Things we've tried:
setting web.config identity impersonate=true
string connectionString = "Server=" + dbServ + ";Database=" + dbName + ";Integrated Security=SSPI;User ID=" + dbUser + ";Password=" + dbPass + ";Trusted_Connection=false;";//windows authentication username/pass from active directory
//string connectionString = "Server="+dbServ+";Database="+dbName+";Trusted_Connection=True;";//trusted connection
//string connectionString = "Server=" + dbServ + ";Database=" + dbName + ";User Id=" + dbUser + ";Password=" + dbPass + ";";//standard security
If I use Trusted_Connection = true
then I just get logged in to SQL server under my account not the test user account that I'm logging in as.
These users will be a part of an active directory group that is also a login we created in sql server(meaning that active directory group is the login).
Is there a way to log someone into sql server via their ActiveDirectory account while on a forms authenticated website? I guess that's the basic question.