Я использую xrmtoolkit и строку подключения для подключения к Dynamics 365 со следующим вызовом: < /p>
var crmServiceClient = new CrmServiceClient(connectionString);
< /code>
Тот же код с той же строкой подключения (те же учетные данные, тот же сервер, тот же Appid и т. Д.) Работает с некоторых машин. Однако из других машин он не удается со следующей ошибкой (некоторые данные, запутанные звездочками): < /p>
http -запрос был запрещен схемой аутентификации клиента 'Anonymous'. Я включил подробное отслеживание, и вот полный журнал трассировки для неудачной попытки подключения: < /p>
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : Initialize CRM connection Started - AuthType: OAuth
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : Direct Login Process Started
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : Attempting to Connect to Uri https://**********.crm.dynamics.com/XRMServices/2011/Organization.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Start: 256 : BuildOrgConnectUri CoreClass ()
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : DiscoveryServer indicated organization service location = https://********.crm.dynamics.com/XRMServices/2011/Organization.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Stop: 512 : BuildOrgConnectUri CoreClass ()
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : Organization Service URI is = https://**********.crm.dynamics.com/XRMServices/2011/Organization.svc
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : ConnectAndInitCrmOrgService - Initializing Organization Service Object
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : ConnectAndInitCrmOrgService - Requesting connection to Organization with CRM Version: No organization data available
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : AuthenticateService - found authority with name https://login.microsoftonline.com/***** ... /authorize
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : AuthenticateService - found resource with name https://********.crm.dynamics.com/
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : ObtainAccessToken - CRED
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Verbose: 16 : Added WebClient Header Hooks to the Request object.
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : ConnectAndInitCrmOrgService - Proxy created, total elapsed time: 00:00:02.5677367
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information: 8 : Querying Organization Instance Details. Request ID: ********-****-****-****-************
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Invalid Login Information : The HTTP request was forbidden with client authentication scheme 'Anonymous'.
Source : mscorlib
Method : HandleReturnMessage
Date : 3/12/2025
Time : 9:29:29 AM
Error : The HTTP request was forbidden with client authentication scheme 'Anonymous'.
Stack Trace : Server stack trace:
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateAuthentication(HttpWebRequest request, HttpWebResponse response, WebException responseException, HttpChannelFactory`1 factory)
at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory`1 factory, WebException responseException, ChannelBinding channelBinding)
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
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.Execute(OrganizationRequest request)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient.c__DisplayClass40_0.b__0()
at Microsoft.Xrm.Sdk.WebServiceClient.WebProxyClient`1.ExecuteAction[TResult](Func`1 action)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient.ExecuteCore(OrganizationRequest request)
at Microsoft.Xrm.Sdk.WebServiceClient.OrganizationWebProxyClient.Execute(OrganizationRequest request)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.RefreshInstanceDetails(IOrganizationService crmService, Uri uriOfInstance)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.DoDirectLogin(Boolean IsOnPrem)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.InitCRM2011Service()
======================================================================================================================
Inner Exception Level 1 :
Source : System
Method : GetResponse
Date : 3/12/2025
Time : 9:29:29 AM
Error : The remote server returned an error: (403) Forbidden.
Stack Trace : at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
======================================================================================================================
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error: 2 : Unable to Login to Dynamics CRM
Source : Not Provided
Method : Not Provided
Date : 3/12/2025
Time : 9:29:29 AM
Error : Unable to Login to Dynamics CRM
Stack Trace : Not Provided
======================================================================================================================
Подробнее здесь: https://stackoverflow.com/questions/795 ... he-http-re
Подключение к Dynamics CRM не удается с надлежащими учетными данными и сообщением, HTTP -запрос был запрещен с помощью с ⇐ C#
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Создайте электронное письмо в Dynamics 365 с помощью php, используя AlexaCRM php-crm-toolkit.
Anonymous » » в форуме Php - 0 Ответы
- 14 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Создайте электронное письмо в Dynamics 365 с помощью php, используя AlexaCRM php-crm-toolkit.
Anonymous » » в форуме Php - 0 Ответы
- 24 Просмотры
-
Последнее сообщение Anonymous
-