When I try to debug this, i could see the way password stored in MSSQL is different than what moodle sends in query.. Please find the php logs below...
please help me guys...
Password stored in MSSQL
uMg8WgxqP+mB3hzcwbeAPqHnty4= danielmoses
Log when the hashing is configured as SHA-1 in external db settings page in moodle
[16-Mar-2014 08:47:40 UTC] sqlsrv_configure: SQLSTATE = IMSSP
[16-Mar-2014 08:47:40 UTC] sqlsrv_configure: error code = -14
[16-Mar-2014 08:47:40 UTC] sqlsrv_configure: message = An invalid parameter was passed to sqlsrv_configure.
[16-Mar-2014 08:47:40 UTC] <hr>connecting... hostname: localhost params: array (
'Database' => 'kpadb',
'UID' => 'sa1',
'PWD' => 'password',
)
[16-Mar-2014 08:47:40 UTC] <hr>running query: 'SELECT *
FROM MoodleAuthentication
WHERE UserName = \'danielmoses\'
AND Password = \'58cb4e2f82599535955e97a110eee6f429cd666d\''<hr>input array: false<hr>result: NULL
[16-Mar-2014 08:47:40 UTC] (before) ADODB_COUNTRECS: 1 _numOfRows: -1 _numOfFields: -1
[16-Mar-2014 08:47:40 UTC] (after) _numOfRows: -1 _numOfFields: 2
[16-Mar-2014 08:47:40 UTC] _fetch()
[16-Mar-2014 08:47:40 UTC] fetch mode: assoc
[16-Mar-2014 08:47:40 UTC] <hr>after _fetch, fields: <pre> backtrace: <pre align=left> <font face="Courier New,Courier">ADORecordset_mssqlnative._fetch()</font><font color=#808080 size=-1> % line 2989, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADORecordSet.Init()</font><font color=#808080 size=-1> % line 1086, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADOConnection._Execute(SELECT * FROM MoodleAuthentication WHERE UserName = '..., false)</font><font color=#808080 size=-1> % line 1044, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADOConnection.Execute(SELECT * FROM MoodleAuthentication WHERE UserName = '...)</font><font color=#808080 size=-1> % line 117, file: <a href="file:/C:\inetpub\wwwroot\moodle\auth\db\auth.php">auth.php</a></font>
<font face="Courier New,Courier">auth_plugin_db.user_login(danielmoses, Dan@1234)</font><font color=#808080 size=-1> % line 4393, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\moodlelib.php">moodlelib.php</a></font>
<font face="Courier New,Courier">authenticate_user_login(danielmoses, Dan@1234)</font><font color=#808080 size=-1> % line 140, file: <a href="file:/C:\inetpub\wwwroot\moodle\login\index.php">index.php</a></font>
</pre>
Log when the hashing is configured as MD-5 in external db settings page in moodle
[16-Mar-2014 08:56:37 UTC] sqlsrv_configure: SQLSTATE = IMSSP
[16-Mar-2014 08:56:37 UTC] sqlsrv_configure: error code = -14
[16-Mar-2014 08:56:37 UTC] sqlsrv_configure: message = An invalid parameter was passed to sqlsrv_configure.
[16-Mar-2014 08:56:37 UTC] <hr>connecting... hostname: localhost params: array (
'Database' => 'kpadb',
'UID' => 'sa1',
'PWD' => 'password',
)
[16-Mar-2014 08:56:37 UTC] <hr>running query: 'SELECT *
FROM MoodleAuthentication
WHERE UserName = \'danielmoses\'
AND Password = \'4518af96674e69424360f61f1f6d129c\''<hr>input array: false<hr>result: NULL
[16-Mar-2014 08:56:37 UTC] (before) ADODB_COUNTRECS: 1 _numOfRows: -1 _numOfFields: -1
[16-Mar-2014 08:56:37 UTC] (after) _numOfRows: -1 _numOfFields: 2
[16-Mar-2014 08:56:37 UTC] _fetch()
[16-Mar-2014 08:56:37 UTC] fetch mode: assoc
[16-Mar-2014 08:56:37 UTC] <hr>after _fetch, fields: <pre> backtrace: <pre align=left> <font face="Courier New,Courier">ADORecordset_mssqlnative._fetch()</font><font color=#808080 size=-1> % line 2989, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADORecordSet.Init()</font><font color=#808080 size=-1> % line 1086, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADOConnection._Execute(SELECT * FROM MoodleAuthentication WHERE UserName = '..., false)</font><font color=#808080 size=-1> % line 1044, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\adodb\adodb.inc.php">adodb.inc.php</a></font>
<font face="Courier New,Courier">ADOConnection.Execute(SELECT * FROM MoodleAuthentication WHERE UserName = '...)</font><font color=#808080 size=-1> % line 117, file: <a href="file:/C:\inetpub\wwwroot\moodle\auth\db\auth.php">auth.php</a></font>
<font face="Courier New,Courier">auth_plugin_db.user_login(danielmoses, Dan@1234)</font><font color=#808080 size=-1> % line 4393, file: <a href="file:/C:\inetpub\wwwroot\moodle\lib\moodlelib.php">moodlelib.php</a></font>
<font face="Courier New,Courier">authenticate_user_login(danielmoses, Dan@1234)</font><font color=#808080 size=-1> % line 140, file: <a href="file:/C:\inetpub\wwwroot\moodle\login\index.php">index.php</a></font>
</pre>