I am exploring Editor Tracking and how it can be used in our production environment. Our arcgis server (10.1) is set to windows authentication which is bound to our companies User Directory. So when we create a web app for external clients, users cannot login using the IdentityManager. All gis services are routed through a proxy and authentication is handled by our windows server using forms authentication. This causes all applyEdits to be tracked as Esri_Anonymous. Is there a way to set the user for an applyEdits operation without using the IdentityManager?
Thanks for the help!!
Alex,
Do you have access to the user info from the forms authentication? If so then you can add a before-apply-edits event handler and place the user name into the data using code.
Robert,
I've given this a try but no luck. The applyEdits operation sets both the created_user and last_edited_user to an empty string.
Thanks,
Alex
Alex,
With out you manually providing the user info in code I would expect them to be empty. As I mentioned in my previous post if you have access to the user info from your forms authentication you can manually add that info using the before-apply-edits event
Here is a snippet of code where I manually set the Editor Tracking user info. When I look at the request being sent to the server all Editor Tracking fields were removed from the graphics.
var userName = "Alex Magruder"; var userEdits = { created_user: userName, last_edited_user: userName }; on(layer, "before-apply-edits", function(data){ data.adds.forEach(function(graphic){ lang.mixin(graphic.attributes, userEdits); }); });
Graphic after before-apply-edits | ApplyEdits request form data |
---|---|
{"attributes":{ "OfflineID":null, "Comments":null, "Value1":null, "created_user":"Alex Magruder", "last_edited_user":"Alex Magruder" }} | {"attributes":{ "OfflineID":null, "Comments":null, "Value1":null }} |
We add this to our main page to make it easy for the JS
@{string userName = User.Identity.Name;}
@Html.Hidden("hfUserName", userName)
hi,
I am in to same issue ,did you find any solution?
Thanks & Regards