We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is any feature in the works already to handle refreshing expired access tokens via the refresh token automatically?
The text was updated successfully, but these errors were encountered:
Doesn't seem like this is maintained anymore but here is a command I made to run every hour to keep the token fresh
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use LifeOnScreen\LaravelQuickBooks\QuickBooksTokenHandlerInterface; use QuickBooksOnline\API\DataService\DataService; class RefreshQuickbooksToken extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'refresh-quickbooks-token'; /** * The console command description. * * @var string */ protected $description = 'Refresh quickbooks token'; /** * Create a new command instance. */ public function __construct() { parent::__construct(); } /** * Execute the console command. * * @return mixed */ public function handle() { $tokenHandler = app(QuickBooksTokenHandlerInterface::class); $oauthToken = DataService::Configure([ 'auth_mode' => config('quickbooks.data-service.auth-mode'), 'ClientID' => config('quickbooks.data-service.client-id'), 'ClientSecret' => config('quickbooks.data-service.client-secret'), 'RedirectURI' => config('quickbooks.data-service.redirect-uri'), 'scope' => config('quickbooks.data-service.scope'), 'baseUrl' => config('quickbooks.data-service.base-url'), 'refreshTokenKey' => $tokenHandler->getRefreshToken(), ])->getOAuth2LoginHelper()->refreshToken(); $tokenHandler->setAccessToken($oauthToken->getAccessToken()); $tokenHandler->setRefreshToken($oauthToken->getRefreshToken()); } }
Sorry, something went wrong.
No branches or pull requests
Is any feature in the works already to handle refreshing expired access tokens via the refresh token automatically?
The text was updated successfully, but these errors were encountered: