c++windowssecuritykerberoswindowsdomainaccount

Kerberos Double Hop and Impersonate calls


I have misunderstanding, I have code:

LogonUser(name,domain, password,LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT,&hToken);
ImpersonateLoggedOnUser(hToken);

and later I do sspi connection with current user to my server(another PC) ImpersonateLoggedOnUser--is it first hop? How many hops I have: 1-connect to server(server thread impersonated to user)
2-logon->impersonate(1 hop)->connect to server(server thread impersonated to user)


Solution

  • need to change LOGON32_LOGON_NETWORK to LOGON32_LOGON_INTERACTIVE :-( and first impersonatewithloggeduser works like not hope(unclear why)