oauth-pythonclient icon indicating copy to clipboard operation
oauth-pythonclient copied to clipboard

Programmatically get authorization code

Open mNemlaghi opened this issue 4 years ago • 9 comments

Hi,

As mentioned here, it seems not possible to automate the way we can get authorization code, before getting access token and refresh token (which is taken into account thanks to get_bearer_token method). This is an issue for browserless, server side solutions interacting with intuit quickbooks API.

Since the refresh token doesn't last more than 1 day (the 100 days was never guaranteed), is there a planned solution for this ? Thanks a lot !

mNemlaghi avatar Jul 21 '21 11:07 mNemlaghi

@mNemlaghi did you find a solution to this?

dantebarba avatar Jan 27 '22 16:01 dantebarba

@mNemlaghi Also interested if you solved this issue.

@IntuitDeveloperRelations - Do you have any recommendations for this?

daccorti avatar Apr 27 '22 16:04 daccorti

@mNemlaghi Any updates? This would be a great feature for server-side applications and lambda-functions.

bdsoha avatar Jul 20 '22 03:07 bdsoha

We've faced the same issue but did some tricks to solve it:

  1. Using OAuth2 fetch the token manually
  2. Store refresh token in environment
  3. Use that refresh_token and refresh it for every request to QuickBooks API.

So based on documentation documentaion hope this will work

Refresh tokens Refresh tokens are valid for 100 days. This expiry date is rolling and gets extended each time it’s used to refresh an access token.

An4ik avatar Jan 10 '23 09:01 An4ik

i ended up just using selenium headless

Donny-GUI avatar Jan 13 '23 22:01 Donny-GUI

Is there no plan to fix the authorization code issue?

aaldaghar avatar Jul 04 '23 16:07 aaldaghar

We've been using the refresh token with no issues but we only have one instance. If you scale to multiple instances or you use lambda functions unfortunately the only way to handle this without requiring scraping the QB webapp is to have a distributed database with the valid refresh token and an atomic control on the token access and renewal.

dantebarba avatar Jul 04 '23 17:07 dantebarba

i ended up just using selenium headless

Do you mind sharing the code you used?

bdsoha avatar Jul 05 '23 05:07 bdsoha