Hi there,
I'm using the latest (6.22.0) version of the .net API. However it seems that the access token is not being automatically refreshed causing a bad request error to be thrown when I try to access any part of the SDK, for example Users.GetCurrentAccountAsync(). I checked the supplied OAuth2 data, I am storing the AccessToken, RefreshToken and the AccessTokenExpiry time. Examining the stored values, I can see that the AccessTokenExpiry time has passed and therefore the access token is no longer valid.
From what I understand, the .net SDK is supposed to get a new access token automatically if it discovers that the supplied token has expired. However this does not appear to be happening. If I update the AccessToken and RefreshToken by relinking to my Dropbox account, everything starts working again. I am creating the SDK client in the following way:
var config = new DropboxClientConfig("ContentAgentDropboxPlugin")
{
HttpClient = httpClient
};
m_dropboxAPIClient = new Dropbox.Api.DropboxClient(Settings.AccessToken, Settings.RefreshToken, (DateTime)Settings.AccessTokenExpiry, AppKey, config);
The values for AccessToken, RefreshToken and AccessTokenExpiry are all retrieved using the correct OAuth2 authentication flow (which redirects to a website hosted by our company which supplies the data passed to it by the Dropbox authentication system to our app).
Does anyone have any idea what might be going wrong?
Many thanks,
Damien