Skip to main content

Notifications

Customer Service forum
Under review by Community Managers

Under review

Thank you for your post! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Connection with Client secret error

Posted on by

We have a c# program that uses CrmServiceClient to connect to Dynamcis 365.

Since end of February, we noticed a lot of connection error, but most of the time it seems to work fine.

 This confuses me is it is ot clear why it works mostly, but sometimes it gives errors.

Also, the error we get, doesn't tell me much, and no innerException found.

Below the error message we receive:

One or more errors occurred. => Unauthorized Http Status Code (401) was expected in the response: Unknown error => A task was canceled.ERROR REQUESTING Token FROM THE Authentication context - General ADAL Error
Unauthorized Http Status Code (401) was expected in the response: Unknown error => A task was canceled.Unable to connect to CRM: A task was canceled.
Unauthorized Http Status Code (401) was expected in the response: Unknown error => A task was canceled.Unable to Login to Dynamics CRM
Unable to Login to Dynamics CRM

Originally we thought this light be caused by overstepping our capacity, but even after cleaning and staying in limits, we still experience, what seems random, connection errors.

Anyone any idea what teh cause could be?

No code chage was implemented at the time ths started.

            //CrmServiceClient serviceTarget = new CrmServiceClient(connectionString);
            CrmServiceClient serviceTarget = new CrmServiceClient(new Uri(organizationUrl), applicationID, clientSecret,true,"");

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 229,147 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans