support kerberos constrained delegation using SSPI for multiprocess

前端 未结 1 1952
灰色年华
灰色年华 2020-12-22 08:39

I need to support Kerberos constrained delegation for our C++ HTTP server product on Windows using SSPI.

For a single process server, the follow workflow can be used

相关标签:
1条回答
  • 2020-12-22 09:22

    What you need to do is get a handle to a token in the parent process and duplicate it into the child process.

    You do it this way:

    In the parent process call ImpersonateSecurityContext as you normally would. This will set your identity. Then call QuerySecurityContextToken to get a handle to the token of that identity. Once you have the handle call DuplicateHandle, but where the target process is a handle to the child process. The returned lpTargetHandle is a locally referenced handle in the target process (the child). You will some how need to transfer this value to the target process.

    Once the child process has the handle value you can call ImpersonateLoggedOnUser passing the handle value. At this point the local identity should be the user in question and any outbound calls will use that when creating the new context.

    Keep in mind though that the child process will need the SeImpersonatePrivilege.

    0 讨论(0)
提交回复
热议问题