Greetings,
We have a SharePoint 2013 farm solution that is globally deployed. If we run it pointing directly to the Central Admin web application it works as expected. However if we run it through a load balancer we get the following error:
System.InvalidOperationException The security token request cannot be completed.at Microsoft.Office.Server.Search.Administration.SearchApi.RunOnServer[T](CodeToRun`1 remoteCode, CodeToRun`1 localCode, Boolean useCurrentSecurityContext, Int32 versionIn)
at Microsoft.Office.Server.Search.Administration.SearchApi..ctor(SearchServiceApplication application)
at Microsoft.Office.Server.Search.Administration.SearchServiceApplication.get_SearchApi()
at Microsoft.Office.Server.Search.Administration.Content.RefreshIfNeeded()
This is the part of the code that triggers the exception:
SearchServiceApplication searchApp = GetSearchApplication(searchAppName);
var content = new Content(searchApp);
string userName;
try
{
userName = content.DefaultGatheringAccount;
}
catch (Exception ex)
{
...
}
This is an extract from a method in the service that we deployed in the farm that deploys a custom BDC model and creates a Content Source in the same farm. The exception happens when attempting to access the content from the Search Service Application.
Some facts:
- The user that does the request has admin permissions in the farm, is a managed account and has a profile.
- The service call only fails when run through the load balancer, not from the Central Admin web app.
Any help would be very appreciated.
Luis