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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

A call to SSPI failed - System.Security.Authentication.AuthenticationException

(0) ShareShare
ReportReport
Posted on by 75

Hi,

We are trying to create cases in Customer Service via .net application by calling dynamics sdk. It works fine in the development environment as we have only one server.

But while running that application in UAT we are getting SSPI error, but for alternate requests. In UAT we have 2 CRM servers that is load balanced.

Tried the below code but still the same:

ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

Any help is highly appreciated.

Error:

System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect

I have the same question (1)
  • Vijitha V Profile Picture
    75 on at
    RE: A call to SSPI failed - System.Security.Authentication.AuthenticationException

    Please find full error below:

    System.ServiceModel.Security.SecurityNegotiationException: A call to SSPI failed, see inner exception. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect

    --- End of inner exception stack trace ---

    at System.Net.Security.NegoState.StartSendAuthResetSignal(LazyAsyncResult lazyResult, Byte[] message, Exception exception)

    at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)

    at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)

    at System.Net.Security.NegoState.StartSendBlob(Byte[] message, LazyAsyncResult lazyResult)

    at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)

    at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)

    at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)

    --- End of inner exception stack trace ---

    Server stack trace:

    at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)

    at System.ServiceModel.Channels.StreamSecurityUpgradeInitiatorBase.InitiateUpgrade(Stream stream)

    at System.ServiceModel.Channels.ConnectionUpgradeHelper.InitiateUpgrade(StreamUpgradeInitiator upgradeInitiator, IConnection& connection, ClientFramingDecoder decoder, IDefaultCommunicationTimeouts defaultTimeouts, TimeoutHelper& timeoutHelper)

    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)

    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)

    at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)

    at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)

    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)

    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)

    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 System.ServiceModel.ICommunicationObject.Open()

    at Microsoft.Crm.Sandbox.SandboxClientBase`1.Open()

    at Microsoft.Crm.Sandbox.SandboxClientBase`1.get_Proxy()

    at Microsoft.Crm.Sandbox.SandboxOrganizationService.Execute(String operation, Byte[] serializedRequest, Object sandboxTraceSettingsObj): Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #EF1088A9

  • Vijitha V Profile Picture
    75 on at
    RE: A call to SSPI failed - System.Security.Authentication.AuthenticationException

    Any update anyone?

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at
    RE: A call to SSPI failed - System.Security.Authentication.AuthenticationException

    Hi,

    What version of CRM dynamics you are using?

    Can you please share your code which you used in your .net application?

    Please see  below blog for the resolution -

    support.tibco.com/.../SecurityNegotiationException-during-plug-in-execution-in-on-premise-CRM-Using-Scribe-Publisher

    Please mark my answer verified if this is helpful!

    Regards,

    Bipin Kumar

    Follow my Blog: xrmdynamicscrm.wordpress.com/

  • Vijitha V Profile Picture
    75 on at
    RE: A call to SSPI failed - System.Security.Authentication.AuthenticationException

    @Bipin, there was no error in event viewer. Thank you for reverting!

    This issue got fixed after adding the below SPNs:

    setspn -u -a MSSQLSvc/dbserver1name.domain:dbport domain\dynamicsinstallationuser

    setspn -u -a MSSQLSvc/dbserver1name.domain domain\dynamicsinstallationuser

    setspn -u -a MSSQLSvc/dbserver2name.domain:dbport domain\dynamicsinstallationuser

    setspn -u -a MSSQLSvc/dbserver2name.domain domain\dynamicsinstallationuser

    setapn -u -a HTTP/applicationserver1name domain\crmapplicationserviceaccount

    setapn -u -a HTTP/applicationserver1name.domain domain\crmapplicationserviceaccount

    setapn -u -a HTTP/applicationserver2name domain\crmapplicationserviceaccount

    setapn -u -a HTTP/applicationserver2name.domain domain\crmapplicationserviceaccount

    Hope this helps someone!!!

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 51 Super User 2025 Season 2

#2
MVP-Daniyal Khaleel Profile Picture

MVP-Daniyal Khaleel 46

#3
CU23101130-0 Profile Picture

CU23101130-0 17

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans