web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

The caller was not authenticated by the service

(0) ShareShare
ReportReport
Posted on by 5

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.
I have the same question (0)
  • Suggested answer
    saurabhtiwarii Profile Picture
    on at

    Hello Modi,

    Thanks for reaching Dynamics community forum.  I see that you have migrated your existing CRM 2016 infra from your locally hosted VM to Azure which means that the identity platform (The domain under which CRM 2016 was initially hosted) must have been changed.

    Also the exception suggests that "security token could not be satisfied because authentication failed" which means that the identity used could not have been validated on the new domain/existing domain for Azure VM.

    Please try to create a new user account on the on-premise AD and map it back to Dynamics CRM and then we may try to see if this new user under the new identity works for you.

    I would also suggest to check SPNs ::

    cloudblogs.microsoft.com/.../

    Please mark my comment as answered if this helps.

  • modi_CRM Profile Picture
    5 on at

    I am using same user which I use for login in Dynamics CRM from browser.

    I'll try and create new user and then connect it.

    Thanks for response

  • modi_CRM Profile Picture
    5 on at

    Thanks for your answer it worked.

    I generated a new user for CRM and used it for connection.

  • saurabhtiwarii Profile Picture
    on at

    Thanks Modi for the update. I am glad to know that that this got fixed. :-) 

    Please mark my comment as answered. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 83 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans