Discuss this help topic in SecureBlackbox Forum

Clouds: Authenticate on Dropbox service on consequent connections

Unforutnately Dropbox doesn't support access token refreshing technology). Instead they offer access tokens with quite long lifespan (currently it's 1 year).

As soon as the access token is saved, there's no need to ask the user about authorization in browser each time the application is started. Instead you can use the saved access token to access the user account on the server.

Also we recommend to keep access token expiration date (see TElDropboxDataStorage.AccessTokenExpiration property) to know, when the token expires and it is time to ask the user for re-authentication. However, this is not required, because the access token can be used until the server returns authentication error. Once the error is returned, you will need to perform authentication as if it were the first-time authentication.

So to use the saved access token you need to

  1. Put App key and App secret, obtained during registration, to TElDropboxDataStorage.AppKey and TElDropboxDataStorage.AppSecret properties respectively. Also you need to set RedirectURL property to the value of the URL, specified as a Redirect URL during registration of your application. These steps are needed for the case, when the access token is not valid.
  2. Put the saved access token and access token expiration date to TElDropboxDataStorage.AccessToken and TElDropboxDataStorage.AccessTokenExpiration properties respectively.
  3. Call TElDropboxDataStorage.StartAuthorization2(). If the method returns the empty string, this means that the access token has been accepted and you can work with files and folders. If the method returns the URL, this means that re-authentication is needed as described in the first-time authentication how-to article.

How To articles about Dropbox cloud

Discuss this help topic in SecureBlackbox Forum