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
    public string OAuthStorage {get; set;}

    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.

    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also