简体   繁体   中英

Test transition from Windows Authentication to SQL Server authentication

I have a windows forms application which connects to an SQL Server 2008 R2 database using variously SMO, databinding, and ODBC connections.

Currently it uses entirely Windows authentication, but a client has requested that we also allow SQL Server logins.

Given the only Windows login I have, and can have, is my own, what can I do to test whether my code is actually using the SQL Server login and not simply connecting using my own Windows login?

Alternatively, what can I do to refine this question so it makes sense?

Thanks

Your question is too general but here are some steps you should take.

  1. Create new sql login and only give necessary permissions to this user
  2. Update all connection strings in your application. If these are not consolidated in one config file now is the good time to do this. You can even consider creating a separate class that will handle this.
  3. Add login form to your app that will be shown at the application startup so that user can enter credentials

Best way to test this is to simply disable your windows user in SQL Server and see if application is still running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM