C#.net中的认证模式 [英] Authendication Mode in C#.net

查看:116
本文介绍了C#.net中的认证模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





使用什么是优点和缺点



Windows认证和SQL Server认证





谢谢

Mohan

解决方案

< blockquote> SQL身份验证



SQL身份验证是用于各种数据库系统的典型身份验证,由用户名和密码组成。显然,SQL Server的一个实例可以有多个这样的用户帐户(使用SQL身份验证),具有不同的用户名和密码。在不同用户应该可以访问不同数据库的共享服务器中,应该使用SQL身份验证。此外,当客户端(远程计算机)连接到运行客户端的计算机之外的其他计算机上的SQL Server实例时,需要SQL Server身份验证。即使您没有定义任何SQL Server用户帐户,在安装时也会使用您提供的密码添加root帐户sa。就像任何SQL Server帐户一样,这可以用于登录本地或远程登录,但是如果应用程序是进行登录的应用程序,并且它应该只能访问一个数据库,那么强烈建议您不要使用sa帐户,而是创建一个访问受限的新帐户。总的来说,SQL身份验证是主要的身份验证方法,我们在下面查看 - 身份验证 - 更方便。



Windows身份验证



当您从安装的同一台计算机访问SQL Server时,不应该提示您输入用户名和密码。如果你正在使用Windows身份验证,那么你就不是。使用Windows身份验证,SQL Server服务已经知道有人使用正确的凭据登录到操作系统,并且它使用这些凭据允许用户进入其数据库。当然,只要客户端与SQL Server位于同一台计算机上,或者只要连接客户端与服务器的Windows凭据匹配,就可以正常工作。 Windows身份验证通常用作登录SQL Server实例而不键入用户名和密码的更方便的方法,但是当涉及更多用户或使用SQL Server建立远程连接时,应使用SQL身份验证。





链接到原始答案: http://stackoverflow.com/questions/750303/what-is-the-differences-between-sql-server- authentication-and-windows-authentica / 3582208#3582208 [ ^ ]



不必要删除了代码块并添加了原始答案[/ edit]


Hi,

What is the advantage and disadvantage of using

Windows Authendication and SQL Server authendication


Thanks
Mohan

解决方案

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.


Link to original answer: http://stackoverflow.com/questions/750303/what-is-the-differences-between-sql-server-authentication-and-windows-authentica/3582208#3582208[^]

[edit]unnecessary Code block removed and original answer added[/edit]


这篇关于C#.net中的认证模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆