I am using following set of API(C++) to validate a windows user name and password (domain account) with MS SQL db:
- LogonUser
- CreateEnvironmentBlock
- ImpersonateLoggedOnUser
- SQLDriverConnect
It works just fine but problem occurs when a service account (domain account but you cant log-in in windows using it) is used to for validation. it fails in the LogonUser API.
Is there any way in C++ or .net (Framework 2.0) to validate a domain account with MS SQL db without using impersonation mechanism?
Thanks,
Rahul
Maybe instead of using
LogonUser, maybe you could try using LogonUserEx it allows you to specify the type of logon you are requesting. With a dwLogonType = LOGON32_LOGON_SERVICE