Hello All,
I have installed Dynamics CRM 2016 on-premise.
I had it installed on different infrastructure and for some reason, I have to move it to a new infrastructure on azure.
So, I did move everything and it is up & running but when I try to connect it to my API code which is .net SDK.
I use organization SVC for connection.
but whenever I try to call my API it throws this error:
{
"message": "An error has occurred.",
"exceptionMessage": "The caller was not authenticated by the service.",
"exceptionType": "System.ServiceModel.Security.SecurityNegotiationException",
"stackTrace": "\r\nServer stack trace: \r\n at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)\r\n at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)\r\n at System.ServiceModel.Security.SecurityProtocol.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)\r\n at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)\r\n at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)\r\n at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)\r\n\r\nException rethrown at [0]: \r\n at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)\r\n at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)\r\n at Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest request)\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.ExecuteCore(OrganizationRequest request)\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Execute(OrganizationRequest request)\r\n at Microsoft.Xrm.Client.Services.OrganizationService.<>c__DisplayClass19.<Execute>b__18(IOrganizationService s)\r\n at Microsoft.Xrm.Client.Services.OrganizationService.InnerOrganizationService.UsingService[TResult](Func`2 action)\r\n at Microsoft.Xrm.Client.Services.OrganizationService.Execute(OrganizationRequest request)\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request)\r\n at Microsoft.Xrm.Client.CrmOrganizationServiceContext.Microsoft.Xrm.Sdk.IOrganizationService.Execute(OrganizationRequest )\r\n at Microsoft.Xrm.Sdk.Client.OrganizationServiceContext.Execute(OrganizationRequest request)\r\n at Microsoft.Xrm.Sdk.Linq.QueryProvider.RetrieveEntityCollection(OrganizationRequest request, NavigationSource source)\r\n at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute(QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups, String& pagingCookie, Boolean& moreRecords)\r\n at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](QueryExpression qe, Boolean throwIfSequenceIsEmpty, Boolean throwIfSequenceNotSingle, Projection projection, NavigationSource source, List`1 linkLookups)\r\n at Microsoft.Xrm.Sdk.Linq.QueryProvider.Execute[TElement](Expression expression)\r\n at Microsoft.Xrm.Sdk.Linq.QueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression)\r\n at System.Linq.Queryable.First[TSource](IQueryable`1 source)\r\n at CRM_Authentication_API.Providers.RepositoryReciget.<GetUserIdFromBagCode>d__24.MoveNext() in D:\\Projects\\Reciget\\Code\\RecigetBackEnd\\CRM Authentication API\\Providers\\RepositoryReciget.cs:line 508\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n at CRM_Authentication_API.Providers.RepositoryReciget.<GetUserFromBagCode>d__23.MoveNext() in D:\\Projects\\Reciget\\Code\\RecigetBackEnd\\CRM Authentication API\\Providers\\RepositoryReciget.cs:line 421\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at CRM_Authentication_API.Controllers.RecigetController.<PostUserFromBagCodeAsync>d__15.MoveNext() in D:\\Projects\\Reciget\\Code\\RecigetBackEnd\\CRM Authentication API\\Controllers\\RecigetController.cs:line 187",
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "The request for security token could not be satisfied because authentication failed.",
"exceptionType": "System.ServiceModel.FaultException",
"stackTrace": " at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)\r\n at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)"
}
}
So, if someone can help with that I tried many solutions from the forum but didn't work for me.
Thanks in advance for the help. Tell me if more details are needed.