Skip to main content

Notifications

Microsoft Dynamics CRM forum
Suggested answer

CRM Online | General ADAL Error

Posted on by 10

We are migration our CRM 2016 from onprem to CRM Online using Fast Track from Microsoft.

One of our services in one of our production server had the following problem, when trying to connect to Microsoft.Xrm.Tooling.Connector.CrmService:

One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostERROR REQUESTING Token FROM THE Authentication context - General ADAL Error
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostOne or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostUnable to connect to CRM: An error occurred while sending the request.
One or more errors occurred. => An error occurred while sending the request. => The underlying connection was closed: An unexpected error occurred on a send. => Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. => An existing connection was forcibly closed by the remote hostUnable to Login to Dynamics CRM
Unable to Login to Dynamics CRMOrganizationWebProxyClient is null
OrganizationWebProxyClient is null

We didn't got this problem in development machines environment, not in testing machines environment.

Has anyone got this erro before?

Thanks.

  • Suggested answer
    omvf_m Profile Picture
    omvf_m 10 on at
    RE: CRM Online | General ADAL Error

    Hi, after openning a case with Microsoft support we found the problem.

    We were getting this error on the production machine becausa it was using TLS 1.0, the problem was resoulve when we force the usage of TLS 1.2 (yellow part):

    var connectionString = "authtype=ClientSecret;url=example.crm4.dynamics.com/;clientid=<guid>;ClientSecret=<secret>";

    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

    CrmServiceClient conn = new Microsoft.Xrm.Tooling.Connector.CrmServiceClient(connectionString);

    var service = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

    if (service == null)
    {
        Console.WriteLine($"Error getting IOrganizationService-{conn?.LastCrmError}");
        throw new Exception("Error getting IOrganizationService.");
    }

    More info:

  • Suggested answer
    Guido Preite Profile Picture
    Guido Preite 54,063 Moderator on at
    RE: CRM Online | General ADAL Error

    probably has to do with the package version and the authentication.

    Update to the latest SDK and use an authentication method like clientid/clientsecret (office365 authentication with username/password is not supported)

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,524 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,469 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans