Solved

PHP Windows Authentication SQL Server

Posted on 2009-07-07
6
320 Views
Last Modified: 2013-12-13
I created a program and tested it under a php/mysql platform. I now need to alter my code to use Windows Authentication to connect to a SQL server database. Due to the server configuration, I cannot use mixed mode. I read somewhere that if I create the same usernames on both servers that i could trick the authentication. Could anyone supply me with some example connection strings that I could use to connect to an SQL server with Windows Authentication?
0
Comment
Question by:MrBaseball9
  • 3
  • 2
6 Comments
 
LVL 51

Accepted Solution

by:
tedbilly earned 125 total points
Comment Utility
You cannot trick NTLM authentication.  If PHP is running in IIS it is running in an application pool.   If you use a domain account in the identity of the application pool then use integrated security in the data connection that domain account is used to connect to SQL.  It's a very safe secure way to have a web application communicate with SQL.
0
 
LVL 22

Expert Comment

by:cj_1969
Comment Utility
To add to what tedbilly said, and to I believe address your question ...
If you create identical accounts on both servers and give them the same password then you can use this account on the application pool and use integrated security in the data connection AND grant the account on the SQL server permissions to the database then this should work.
0
 

Author Comment

by:MrBaseball9
Comment Utility
OK, that sounds like what I was reading about.

Is there anything specific about the connection strings for this to happen?
Does anyone have a example that I can mimic?
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 22

Expert Comment

by:cj_1969
Comment Utility
0
 
LVL 22

Assisted Solution

by:cj_1969
cj_1969 earned 125 total points
Comment Utility
If you are using a php driver then you might be stuck providing credentials for the connection string.
If you can use the examples I provided within php great, otherwise try creating a system DSN and configure it to use Windows authentication.  Hopefully this will use the app pool identity when the php script runs to authenticate the connection to the database.
0
 

Author Comment

by:MrBaseball9
Comment Utility
I followed the follorwing tutorial and have managed to connect successfully.

http://msdn.microsoft.com/en-us/library/cc296205(SQL.90).aspx
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now