I've got a standalone on-premise Service Fabric Cluster that is secured using Windows Authentication.
In this application I have a ASP.NET Core WebApi Stateless service that tries to communicate with another stateless service via the remoting. Unfortunately I'm getting the following error when the WebApi service tries to RPC to the stateless service:
System.AggregateException: One or more errors occurred. ---> System.Fabric.FabricConnectionDeniedException: Not authorized to connect ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071C43
at Microsoft.ServiceFabric.FabricTransport.NativeServiceCommunication.IFabricServiceCommunicationClient2.EndRequest(IFabricAsyncOperationContext context)
at Microsoft.ServiceFabric.FabricTransport.Client.FabricTransportClient.EndRequest(IFabricAsyncOperationContext context)
at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
--- End of inner exception stack trace --
Futhermore, I can confirm that
When deploying this same application to a "development cluster" (i.e. either my local machine or another a remote Service Fabric cluster running all it's Nodes on one machine), I don't get the error - hence potentially an issue with the AD accounts I've used to setup my multi-machine cluster (I'm using a machine group account).
When creating the Client Proxy, I do setup the Security Credentials to use windows authentication - i.e.
var transportSettings = new FabricTransportRemotingSettings { SecurityCredentials = new WindowsCredentials() }; Func<IServiceRemotingCallbackClient, IServiceRemotingClientFactory> clientProxyFactory = c => new FabricTransportServiceRemotingClientFactory(transportSettings); var serviceProxyFactory = new ServiceProxyFactory(clientProxyFactory); TService clientProxy = serviceProxyFactory.CreateServiceProxy<TService>(uri); return clientProxy;
In the above code, if I instead use:
SecurityCredentials = new NoneSecurityCredentials()
then I get a similarFabricConnectionDeniedException
but the message is slightly different saying that theClient is not authorised to connect
. This makes sense - but again, potentially indicates that there is an issue with my transport settings...