dotConnect for FreshBooks Documentation
Devart.Data.FreshBooks Namespace / FreshBooksConnectionStringBuilder Class / OAuthStorage Property

In This Topic
OAuthStorage Property
In This Topic
Gets or sets the path to a file, where to store FreshBooks Access and Refresh Tokens between sessions in order to avoid the need to re-authorize the application. This parameter is used for connecting via Alpha API.
Syntax
'Declaration
 
Public Property OAuthStorage As String
 

Property Value

The path to a file, where to store FreshBooks Access and Refresh Token between sessions in order to avoid the need to re-authorize the application.
Remarks

The file is a two-line text file with AccessToken on the first line and RefreshToken on the second line. You may specify the RefreshToken and AccessToken parameters in the connection string or create such a file with tokens yourself, specify the path to it in the OAuthStorage parameter, and omit the token parameters in the connection string.

Whenever AccessToken needs to be regenerated (it expires after 12 hours since retrieving), dotConnect for FreshBooks automatically updates this file or creates such file if it doesn't exist. This is done because RefreshToken is used to retrieve a new AccessToken, but it is reset too during the refresh process. Thus, you cannot use the same tokens for the connection. dotConnect for FreshBooks manages these tokens automatically, and sets them to the new values when necessary. And it uses the file specified in the OAuthStorage property to store the current tokens in order to load and use them when the application is closed and then started again so that you don't need to re-authenticate and retrieve new tokens every time when the application starts.

See Also