0

I am trying to get an access token using Forge DA using the code below. But it throws the following exception:

An exception of type 'Autodesk.Forge.Client.ApiException' occurred in mscorlib.dll but was not handled in user code. Additional information: Error calling Authenticate: The underlying connection was closed: An unexpected error occurred on a send.

Here is my code:

TwoLeggedApi oAuth = new TwoLeggedApi();
dynamic token = await  oAuth.AuthenticateAsync(
   txtClientId.Text,
   txtClientSecret.Text,
   oAuthConstants.CLIENT_CREDENTIALS ,
   new Scope[] { Scope.BucketRead, Scope.BucketCreate, Scope.DataRead, Scope.DataWrite });
theduck
  • 2,589
  • 13
  • 17
  • 23
sruthi T
  • 3
  • 1

2 Answers2

0

I recommend that you use the Design Automation SDK here. This one allows you to access the new V3 API while the one I presume you are using can only access the now deprecated V2 API.

Here's a sample that uses this SDK.

Albert Szilvasy
  • 461
  • 3
  • 5
0

Since the error is calling out connection make sure your system can reach our service from your network (check proxy, firewall etc, can you reach our other endpoints?) and it supports TLS 1.2 - see here

Bryan Huang
  • 5,247
  • 2
  • 15
  • 20