Hi,
We are developing a Server Side Plug-in used to get a snapshot from a specified camera. To do so we are using some code form MIP SDK samples.
The plugIn first gets an authorization token from management server then uses it ask for snapshot to Recording server.
The plug-in runs well on simple environment where event server and management server are on same machine, but fails in production environment where the two services are spreaded on two different servers. In the latter scenario we get this error when plug-in try to authenticate on management server:
System.ServiceModel.Security.SecurityNegotiationException: SOAP security negotiation with ‘http://a91-vdsmngl2.anasnet.it/ManagementServer/ServerCommandService.svc’ for target ‘http://a91-vdsmngl2.anasnet.it/ManagementServer/ServerCommandService.svc’ failed. See inner exception for more details.
- → System.ComponentModel.Win32Exception: Security Support Provider Interface (SSPI) authentication failed.
The server may not be running in an account with identity ‘host/a91-vdsmngl2.anasnet.it’.
If the server is running in a service account (Network Service for example), specify the account’s ServicePrincipalName as the identity in the EndpointAddress for the server.
If the server is running in a user account, specify the account’s UserPrincipalName as the identity in the EndpointAddress for the server.
The error seems causated in the connect method of SystemAccess class:
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at ServerCommandService.IServerCommandService.Login(Guid instanceId, String currentToken)
at ServerCommandService.ServerCommandServiceClient.Login(Guid instanceId, String currentToken) in [C:\Program](file:C:/Program) Files\Milestone\MIPSDK\ProtocolSamples\ServerCommandWrapper\ServerCommandService.cs:line 7799
at ServerCommandWrapper.Ntlm.NtlmConnection.Login() in [C:\Program](file:C:/Program) Files\Milestone\MIPSDK\ProtocolSamples\ServerCommandWrapper\NtlmConnection.cs:line 170
at ServerCommandWrapper.Ntlm.NtlmConnection.Login(Guid integrationId, String version, String integrationName) in [C:\Program](file:C:/Program) Files\Milestone\MIPSDK\ProtocolSamples\ServerCommandWrapper\NtlmConnection.cs:line 188
at AccessControl.Background.SystemAccess.Connect(String server) in [C:\Sviluppi\AnasXp\RMTConnector\Background\SystemAccess.cs](file:C:/Sviluppi/AnasXp/RMTConnector/Background/SystemAccess.cs):line 65
at AccessControl.Background.RestService.cameraSnapshot(IHttpContext context) in [C:\Sviluppi\AnasXp\RMTConnector\Background\RestService.cs](file:C:/Sviluppi/AnasXp/RMTConnector/Background/RestService.cs):line 991
this is the code of method:
public void Connect(String server)
{
if (\_basicConnection != null)
{
\_basicConnection.OnTokenRefreshed -= \_connection\_OnTokenRefreshed;
\_basicConnection.Logout();
\_basicConnection = null;
}
if (\_ntlmConnection != null)
{
\_ntlmConnection.OnTokenRefreshed -= \_connection\_OnTokenRefreshed;
\_ntlmConnection.Logout();
\_ntlmConnection = null;
}
Server = server;
switch (AuthenticationType)
{
case AuthenticationType.Basic:
{
int port = 443;
\_basicConnection = new BasicConnection(User, Password, Server, port);
LoginInfo = \_basicConnection.Login(IntegrationId, Version, IntegrationName);
\_basicConnection.OnTokenRefreshed += \_connection\_OnTokenRefreshed;
break;
}
case AuthenticationType.Windows:
case AuthenticationType.WindowsDefault:
{
\_ntlmConnection = new NtlmConnection(Domain, AuthenticationType, User, Password, Server);
LoginInfo = \_ntlmConnection.Login(IntegrationId, Version, IntegrationName);
\_ntlmConnection.OnTokenRefreshed += \_connection\_OnTokenRefreshed;
break;
}
default:
//empty
break;
}
}
The class was taken from MIPSDK samples code.
We cannot understand where is the problem and how to solve, can you help us?
Many Thanks
