I have a webApp that is generating a PDF. I'm looking for a way to write the PDF to a directory that only allows "User1" access to the folder. The password for "User1" is retrieved through a webservice using a stored key on the server. I don't know how I'm supposed to set the User/Password before writing the file to directory. Normally, I think this just uses the username and pass that the application was started under. I feel like I've looked everywhere for these options. Is this doable?
Stephan van Hulst
posted 1 week ago
I haven't done this before in Java, but you can try messing with java.security.auth.Subject.doAs(Subject, PrivilegedAction), where you pass the user credentials using a Subject and open the file inside the PrivilegedAction.
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.