sql server - Impersonation failing for database connection -
i have sl4 app uses wcf communicate backend sql server 2008 database. 1 of wcf services needs connect database dedicated system account due database permissions required stored procedure called. have attempted implement solution using impersonation within service code e.g.
int result = logonuser(username, domain, password, logon32_logon_network, logon32_provider_default, out _token); if (result > 0) { impersonateloggedonuser(_token); //code here call nhibernate data access code }
my connection string service is:
<add name="myconnection" connectionstring="data source=servername\instance;initial catalog=mydatabase;integrated security=sspi" providername="system.data.sqlclient"/>
however, data access routine still failing following message:
login failed user 'nt authority\anonymous logon'.
the impersonation being ignored in database connection. ideas?
change logon32_logon_network
logon32_logon_network_cleartext
in call logonuser
.
this caches logon credentials in local security provider, should enable successful sspi handshake sql server.
Comments
Post a Comment