peeter123 / digikey-api

Python module for the Digikey PartSearch API
GNU General Public License v3.0
85 stars 35 forks source link

Using the python script headless gives issues respawning the browser for OAuth2 #33

Open Ash-Labs opened 2 years ago

Ash-Labs commented 2 years ago

I am using the script succesfully in conjuction with a php framework. I call the script and reply the data in JSON format.

When it needs to re-authorize it should open the browser.

Example: REFRESH - Failed to use refresh token, starting new authorization flow.

Then i use this in a GUI type call from terminal this works without any issues. When calling the script from inside my PHP framework, or headless from SSH, it refuses to open the browser and the script is broken. Is there any way i can resolve this issue ?

Ash-Labs commented 2 years ago

So there is a possibility for a long expiration time for the OAuth token.

https://cloud.google.com/apigee/docs/api-platform/antipatterns/oauth-long-expiration