Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is the differences between sql server authentication and windows authentication..?

Tags:

sql-server

what is the difference between sql server authentication and windows authentication...Is there any specific situation of using each authentication?

like image 671
sivaramakrishna Avatar asked Apr 15 '09 04:04

sivaramakrishna


People also ask

What is difference between SQL authentication and Windows Authentication?

Connecting Through Windows Authentication SQL Server does not ask for the password, and does not perform the identity validation. Windows Authentication is the default authentication mode, and is much more secure than SQL Server Authentication.

What is the difference between SQL login and Windows login?

Windows authentication is generally more secure in SQL Server databases than database authentication, since it uses a certificate-based security mechanism. Windows-authenticated logins pass an access token instead of a name and password to SQL Server.

What is SQL Server and Windows Authentication mode?

Windows authentication uses a series of encrypted messages to authenticate users in SQL Server. When SQL Server logins are used, SQL Server login names and encrypted passwords are passed across the network, which makes them less secure.

What is the meaning of Windows Authentication?

Windows authentication (formerly named NTLM, and also referred to as Windows NT Challenge/Response authentication) is a secure form of authentication because the user name and password are hashed before being sent across the network.


2 Answers

SQL Server has its own built in system for security that covers logins and roles. This is separate and parallel to Windows users and groups. You can use just SQL security and then all administration will occur within SQL server and there's no connection between those logins and the Windows users. If you use mixed mode then Windows users are treated just like SQL logins.

There are a number of features of each approach -

1) If you want to use connection pooling you have to use SQL logins, or all share the same windows user - not a good idea.

2) If you want to track what a particular user is doing, then using the windows authentication makes sense.

3) Using the windows tools to administer users is much more powerful than SQL, but the link between the two is tenuous, for instance if you remove a windows user then the related data within SQL isn't updated.

like image 189
MrTelly Avatar answered Sep 19 '22 11:09

MrTelly


SQL Authentication

SQL Authentication is the typical authentication used for various database systems, composed of a username and a password. Obviously, an instance of SQL Server can have multiple such user accounts (using SQL authentication) with different usernames and passwords. In shared servers where different users should have access to different databases, SQL authentication should be used. Also, when a client (remote computer) connects to an instance of SQL Server on other computer than the one on which the client is running, SQL Server authentication is needed. Even if you don't define any SQL Server user accounts, at the time of installation a root account - sa - is added with the password you provided. Just like any SQL Server account, this can be used to log-in localy or remotely, however if an application is the one that does the log in, and it should have access to only one database, it's strongly recommended that you don't use the sa account, but create a new one with limited access. Overall, SQL authentication is the main authentication method to be used while the one we review below - Windows Authentication - is more of a convenience.

Windows Authentication

When you are accessing SQL Server from the same computer it is installed on, you shouldn't be prompted to type in an username and password. And you are not, if you're using Windows Authentication. With Windows Authentication, the SQL Server service already knows that someone is logged in into the operating system with the correct credentials, and it uses these credentials to allow the user into its databases. Of course, this works as long as the client resides on the same computer as the SQL Server, or as long as the connecting client matches the Windows credentials of the server. Windows Authentication is often used as a more convenient way to log-in into a SQL Server instance without typing a username and a password, however when more users are envolved, or remote connections are being established with the SQL Server, SQL authentication should be used.

like image 35
Manoj Kumar Kola Avatar answered Sep 17 '22 11:09

Manoj Kumar Kola