ArcGIS Server - Retrieve user info from the token in a protected geopressing service

888
2
09-15-2016 06:31 AM
Status: Open
MaximeDemers
Occasional Contributor III

Let say you have a geoprocessing service made of a python script. This GP service is protected with token. It could be very useful to be able to retrieve the info of the user who made a request to this service. (username, fullname, role, email, etc...)

With the token security, you can able or enable requests to a service, but in the GP service, different action could be made depending of the user who made the request.

For instance, imagine a GP service that allow editing some fields values in a table. It would be nice if we could allow edits on perticular rows depending of the user. Without the information about the user, everyone who has a token can edit all the rows.

2 Comments
Ranga_Tolapi

User information can be determined from the token using "arcgis/rest/self" API as shown below:
https://<servername>:6443/arcgis/rest/self?f=pjson&token=<token>

MaximeDemers

Thank you very much! I have ask in many forums and look in the documentation and I have never found that information.

Do you know, in reverse, if it's possible to retrieve the token information from a username? For instance, get the list of active tokens for a perticular user or just knowing if a token is active for a user or not