function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Surinder BhomraSurinder Bhomra 

Salesforce .NET Toolkit Error - "Authentication Error"

I have been looking into getting information, such as Contacts from a Developer Salesforce account I have created. I downloaded the Sample  .NET Console application from the Force.com Toolkit for .NET Github repository. However, I am getting an "Authentication Error" response when trying to authenticate using the OAuth key and secret ID's.

I haven't modfied the code from the Github sample in any way, so I am at a loss to why this error is being returned.

From reading multiple posts online, this is what I have done to try and fix the issue:
  • Created a new Connected App that has:
    • All users may self-authorize
    • Relax IP Restrictions
    • Application permission set to "Full Access".
    • Generated Consumer Key and Secret.
  • Generated a Security Token from my logged in account (that has full System Admin access)
  • Ensure the user role has API Enabled.
I am at a loss to what else I need to do in order to get API access.

Any help would be appreciated.
Best Answer chosen by Surinder Bhomra
NagendraNagendra (Salesforce Developers) 
Hi Surindher,

First and foremost sincerely regret for the delayed reply.

As this post is already answered from stack exchange community as below:

TLS 1.1 or 1.2 is required to access salesforce always for sand box for prod depends on if the critical update is turned on]. Unfortunately, the default TLS version for many versions of .NET is 1.0, which causes problems. See this(https://github.com/developerforce/Force.com-Toolkit-for-NET/issues/208) issue in the toolkit project about TLS versions

Kindly mark this post as solved so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P

All Answers

NagendraNagendra (Salesforce Developers) 
Hi Surindher,

First and foremost sincerely regret for the delayed reply.

As this post is already answered from stack exchange community as below:

TLS 1.1 or 1.2 is required to access salesforce always for sand box for prod depends on if the critical update is turned on]. Unfortunately, the default TLS version for many versions of .NET is 1.0, which causes problems. See this(https://github.com/developerforce/Force.com-Toolkit-for-NET/issues/208) issue in the toolkit project about TLS versions

Kindly mark this post as solved so that it gets removed from the unanswered queue and becomes a proper solution which results in helping others who are really in need of it.

Best Regards,
Nagendra.P
This was selected as the best answer
Surinder BhomraSurinder Bhomra
Thanks Nagenda for the response, I managed to resolve it in the way you suggested.