Skip to main content

Notifications

Announcements

No record found.

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

  • Vijitha V Profile Picture
    Vijitha V 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!!!

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 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
    Vijitha V 75 on at
    RE: A call to SSPI failed - System.Security.Authentication.AuthenticationException

    Any update anyone?

  • Vijitha V Profile Picture
    Vijitha V 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans