Can you tell me how do you trim the url and how do you access to the home level of the service? I haven't tested similar case but it should work if you keep the token defined in every request.
If you access to layers (webmap) via Document, remember to set Token property.
If you are accessing to layer via Layer (ie. dynamic), make sure that Token gets set.
If you are accessing via custom http call using ArcGISWebClient it doesn't automatically activate IdentityManger so it should be activated before using it.
If you are accessing to layer via custom http call, remember to keep ?token=<token> defined.
But if you tell how you access to the home level of the service, maybe I can give better pointers.
I think it should be the same Token.
I try to have time today to test this out. How do you query the root level? I suppose that is a custom REST call?
IdentityManager.Current.GenerateCredentialAsync(
"http://www.arcgis.com/sharing/rest/",
"", // here should be your username
"", // here should be your password
(credential, ex) =>
{
if (ex != null)
{
MessageBox.Show(ex.ToString());
return;
}
var webClient = new ArcGISWebClient();
var parameters = new Dictionary<string, string>
{
{ "f", "json" },
{ "token", credential.Token}
};
webClient.DownloadStringCompleted += (sender, args) =>
{
MessageBox.Show(args.Result.ToString());
};
webClient.DownloadStringAsync(new Uri("http://services.arcgis.com/AddYourIdentity/ArcGIS/rest/services"), parameters);
});