In a recent question at gis.stackexchange.com one of the users asked the following question:
Is there any way to identify user within execute() method of a GeoServer process?
After processing of data within WPS I want to place the result in a folder with a name that corresponds to username, then to send the user URL to access it. To do that, I need a mechanism to determine username within execute() method of my process class. How to do that?
I suggested said I would start researching this issue by turning on extended logging on geoserver. Then use grep (linux) for the actual request from the log and see which user name is associated with the request. If it is the user is home free and can start finding out how to implement a solution using python or other scripting languages to do this programmatically.
I am wondering if there are other ways of doing this? I am not even sure if my rather “hacky” approach will solve the challenge. If anyone has the answer I will be more than happy to forward the info to the user. The address for the question is:
http://gis.stackexchange.com/questions/132071/is-there-any-way-to-identify-user-within-execute-method-of-a-geoserver-process
Ragnvald
Ragnvald,
I believe you can get the authenticated user from:
Authentication user = SecurityContextHolder.getContext().getAuthentication();
with the name available from user.getName()
···
On Tue, Mar 10, 2015 at 4:24 AM, Ragnvald Larsen <ragnvald.larsen@anonymised.com> wrote:
In a recent question at gis.stackexchange.com one of the users asked the following question:
Is there any way to identify user within execute() method of a GeoServer process?
After processing of data within WPS I want to place the result in a folder with a name that corresponds to username, then to send the user URL to access it. To do that, I need a mechanism to determine username within execute() method of my process class. How to do that?
I suggested said I would start researching this issue by turning on extended logging on geoserver. Then use grep (linux) for the actual request from the log and see which user name is associated with the request. If it is the user is home free and can start finding out how to implement a solution using python or other scripting languages to do this programmatically.
I am wondering if there are other ways of doing this? I am not even sure if my rather “hacky” approach will solve the challenge. If anyone has the answer I will be more than happy to forward the info to the user. The address for the question is:
http://gis.stackexchange.com/questions/132071/is-there-any-way-to-identify-user-within-execute-method-of-a-geoserver-process
Ragnvald
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
Geoserver-users mailing list
Geoserver-users@anonymised.comsts.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users