phpLens
 home  products examples manual  faq support forum  contact news  login store

Forums: phplens   adodb
Forums:   ADOdb Help & Dev:   Replies 
New ReplySearch
Topic: ms sql windows authentication connect
author: Kgee   created: 12-06-2012 08:57:57 AM
I have an ms sql server which normally uses windows authentication to authenticate users. These users are logged in with a 'DOMAIN\username' format.

After fighting with authentication for a bit, I started reading the login failure logs on the server between these two bits of code:

$DB = mssql_connect('MYSERVER','username', $Pass)
or die('could not connect.');

versus

$DB = mssql_connect('MYSERVER','DOMAIN\username', $Pass)
or die('could not connect.');

The first creates a 'failed login attempt' error on the database side, while the second doesn't even get that far. I'm not convinced it tries to log in at all once a slash '\' enters the username. After a few attempts to escape this, I'm convinced more and more that it's not a matter of escaping the string, but adodb not supporting the windows authentication method.

Is there a way to get around this, or should I be using another authentication tool such as an ldap library?
Topic: Re:ms sql windows authentication connect
author: John Lim   created: 18-06-2012 01:00:04 AM
It's the mssql extension that is causing the problem, with the adodb mssql driver uses. The mssql extension is based on a legacy sql server protocol that is actually used in sybase compat mode, so it is unlikely to support windows authentication.

For window's authentication, you need to use odbc with window's authentication enabled.
Topic: Re:ms sql windows authentication connect
author: tomkraw1   created: 10-08-2012 02:32:54 AM
@Kgee: Did you try mssqlnative? Driver mssql is dying since PHP 5.3.
Page 1
New ReplySearch

View Source

email: contact#phplens.com (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800