/// <summary> /// Get the OAuth tokens required to access the cloud based API (Synchronous) /// </summary> /// <param name="code">The code received after the user has given the application permission to access their company files</param> /// <param name="cancellationToken"></param> /// <returns>The tokens that are required to access the user's company files</returns> async public Task<OAuthTokens> GetTokensAsync(string code, CancellationToken cancellationToken) { var handler = new OAuthRequestHandler(_configuration); var request = this.Factory.Create(OAuthRequestHandler.OAuthRequestUri); var tokens = await handler.GetOAuthTokensAsync(request, code, cancellationToken); return tokens.Item2; }