Windows Integrated authentication connects the SQL Server database to create a more secure connection

Source: Internet
Author: User
Tags create domain
Summary: Today, write a Windows service program in C # that connects to a SQL Server 2000 database on a Windows 2003 server, using SQL Server Authentication. Common programs are found to be able to be linked, but Windows service programs are not.
Later, I looked up the data and found the solution. Share to everyone.
Three-Step solution:
1, create a user on the server, configure the SQL Server database access rights.
2. Create an identical user on the client.
3, the service program with the newly created client user login.
Get!

Keywords: SSPI, integrated security, SQL Server and Windows, authentication, SQL Server does not exist, or access is denied.

Reference documentation: Windows Authentication and SQL Server
Http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/f_and_m/html/vxconWindowsAuthenticationSQLServer.asp

Visual Studio Example: Fitch and Mather 7.0

Windows Authentication and SQL Server
Fitch and Mather 7.0 accesses SQL Server through SQL Server authentication. Although it is very simple and provides an easy to understand example, it is not the safest method. Fitch and Mather 7.0 stores connection strings (including database credentials) in two locations: Web.config files and COM + Admin directories (in the Fmstocks7.gam.7 component's constructor string). By default, any user can read both locations, so it is easy to inadvertently disclose confidential information (credentials).
A better solution is to use Windows integrated security. First, you need the Windows identity that is recognized by both the Internet Information Services (IIS) server and the SQL Server database. There are two ways to choose:
· Domain account
This is the best approach if the server is part of a domain and the administrator can create domain accounts for the application.
· Local account with sync password
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.