Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OAuth 2.0 .NET error

I've been trying to get OAuth 2.0 working with the Async calls..  I finally got it to allow me to log in, however, when I try and do a call to get data from the Fibit.Api.Portable.. i'm getting the following error:

 

Searches related to Method System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[Fitbit.Api.Portable.OAuth2.OAuth2AccessToken].AwaitUnsafeOnCompleted: type argument 'Microsoft.Runtime.CompilerServices.TaskAwaiter`1[System.String]' violates the constraint of type parameter 'TAwaiter'.

 

This is from this line of code:

System.Threading.Tasks.Task<Fitbit.Api.Portable.OAuth2.OAuth2AccessToken> accessToken = authenticator.ExchangeAuthCodeForAccessTokenAsync(code);

 

The code parameter is a string.. " b76ede61d0b5e357172d98c6137caf5fcad49415"

 

I'm not sure why this is happening.  Has anyone else had this issue?

 

I'm trying to use the code in a .NET webforms project.  

 

The Fitbit.Api.Portable can be found on GitHub.

 

any help with this would be great.

Thanks.

Best Answer
0 Votes
0 REPLIES 0