Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

The request for security token could not be satisfied because authentication failed (The caller was not authenticated by the service) - Dynamics CRM 2013

$
0
0

Hi Team,

I have developed an ASP.NET website where I am retrieving User Details. I have deployed this website into IIS and accessing this Page from CRM Sitemap.

This page is working fine in DEV and UAT environment but when we move to Production getting below error message. 

We are using same user account in UAT and Production and this use is Sysem admin in both the environments. 

Service Creation Code:

I have tried both options like simplified and normal method:

#region Simplified Connection
string connectionString = "Url=" + url + "; Domain=" + domain + "; Username=" + username + "; Password=" + password + ";";
CrmConnection connection = CrmConnection.Parse(connectionString);
OrganizationService orgService = new OrganizationService(connection);
return orgService;
#endregion

#region CRM Service Creation
ClientCredentials credentials = new ClientCredentials();

if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password) || string.IsNullOrEmpty(domain))
{
throw new Exception("Error: Non-default connection requires username, password and domain!");
}
else if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(domain))
{
credentials.Windows.ClientCredential = new System.Net.NetworkCredential(username, password, domain);
}

OrganizationServiceProxy orgService = new OrganizationServiceProxy(new Uri(url), null, credentials, null);
orgService = (OrganizationService)orgService;
return orgService ;
#endregion

Error details from Event Viewer:

Polls chart Issue -RP - Send an email to HelpIT for incident and Hadi for verification

Try and send a mail to Saranya on MyInfo Prod

MTI 2FA - Find alternative, Raise an SR for tomorrow


Event code: 3005
Event message: An unhandled exception has occurred.
Event time: DateTime
Event time (UTC): DateTime
Event ID: EventID
Event sequence: 19
Event occurrence: 4
Event detail code: 0

Application information:
Application domain: APPDomain
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\MyWebsite\
Machine name: SERVERNAME

Process information:
Process ID: 2460
Process name: w3wp.exe
Account name: NT AUTHORITY\NETWORK SERVICE

Exception information:
Exception type: SecurityNegotiationException
Exception message: The caller was not authenticated by the service.

Server stack trace:
at System.ServiceModel.Security.IssuanceTokenProviderBase`1.DoNegotiation(TimeSpan timeout)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Security.CommunicationObjectSecurityTokenProvider.Open(TimeSpan timeout)
at System.ServiceModel.Security.SymmetricSecurityProtocol.OnOpen(TimeSpan timeout)
at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.SecurityChannelFactory`1.ClientSecurityChannel`1.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)
at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

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 Microsoft.Xrm.Sdk.IOrganizationService.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveCore(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Client.Services.OrganizationService.<>c__DisplayClass10.<Retrieve>b__f(IOrganizationService s)
at Microsoft.Xrm.Client.Services.OrganizationService.InnerOrganizationService.UsingService[TResult](Func`2 action)
at Microsoft.Xrm.Client.Services.OrganizationService.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at _2FAuthentication.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The request for security token could not be satisfied because authentication failed.
at System.ServiceModel.Security.SecurityUtils.ThrowIfNegotiationFault(Message message, EndpointAddress target)
at System.ServiceModel.Security.SspiNegotiationTokenProvider.GetNextOutgoingMessageBody(Message incomingMessage, SspiNegotiationTokenProviderState sspiState)



Request information:
Request URL: PageURL
Request path: /MyPage.aspx
User host address: IPAddress
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\NETWORK SERVICE

Thread information:
Thread ID: 17
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at Microsoft.Xrm.Sdk.IOrganizationService.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.RetrieveCore(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Sdk.Client.OrganizationServiceProxy.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at Microsoft.Xrm.Client.Services.OrganizationService.<>c__DisplayClass10.<Retrieve>b__f(IOrganizationService s)
at Microsoft.Xrm.Client.Services.OrganizationService.InnerOrganizationService.UsingService[TResult](Func`2 action)
at Microsoft.Xrm.Client.Services.OrganizationService.Retrieve(String entityName, Guid id, ColumnSet columnSet)
at _2FAuthentication.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images