Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sspi impersonation #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

giuliohome
Copy link

@giuliohome giuliohome commented Nov 12, 2021

I'm trying to use an access token from node-expose-sspi to impersonate the authenticated user as described in this scenario.

@giuliohome
Copy link
Author

giuliohome commented Nov 16, 2021

My conclusion.
I have compared C# impersonation with Node.js impersonation. The problem is the return from the Napi call to Node.js. The pure C++ impersonation - i.e. the impersonateLoggedOnUser with a token from a LogonUserW - is successful exactly like C#, that is correctly wrapping a C++ call through DllImport of InteropServices. If I write a file from C++ the owner of the file written is the impersonated user. The problem is that when the control is returned to Node.JS after the wrapped Napi call (on the opposite of what happens with C# interop) the impersonation is lost.

Again I doubt that this is a specific problem of my debug environment details, I rather think that the reply received from stackoverflow forum about it has been wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant