Given the Java Servlet (runs on a Windows server) that creates a new process through ProcessBuilder, what are my options for starting this new process as the user who called the original web request for the servlet?
To clarify, I want something like
ProcessBuilder pb = new ProcessBuilder("whoami"); Process p = pb.start();
And the real goal is to perform some security checks (for example, see if a user can open a file or view a certain record in the internal corporate system).
Obviously, the user needs to somehow authenticate with either the application server or Java code. Ideally, I would like it to be in some way that works with one character (i.e., without entering a password by the user) and this is fine if the solution works only with Windows clients that are already logged into the domain (although even better if this is not a limitation). I am currently using Jetty as an application server, but if necessary, switching to something else will certainly be a viable option.
(If this helps clarify, I basically want to replace the CGI script, which currently uses the IIS impersonation functions to run in the context of the user making the request)
source share