Skip to content
New issue

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

OAuth Out-Of-Band (OOB) migration for production app #586

Open
francot opened this issue Aug 29, 2023 · 2 comments
Open

OAuth Out-Of-Band (OOB) migration for production app #586

francot opened this issue Aug 29, 2023 · 2 comments

Comments

@francot
Copy link

francot commented Aug 29, 2023

Following this discussion:
#530

pygsheets auth have to manage Out-Of-Band Oauth deprecation for production app.

Documentation at https://developers.google.com/identity/protocols/oauth2/resources/oob-migration report:

The OOB flow is being deprecated for all client types i.e. Web applications, Android, iOS, Universal Windows Platform (UWP), Chrome apps, TVs & limited-input devices, Desktop apps.
This deprecation is only applicable to production apps (i.e apps with publishing status set to In Production. The flow will continue to work for apps with the Testing publishing status.

The workaround suggest in #530 works. At the end The flow generates a url like:

http://localhost/?state=FbsVj5ofyyuTF2O1ZmjF0Bs1jbh5Xx&code=--code-to-paste-for-auth--&scope=https://www.googleapis.com/auth/drive%20https://www.googleapis.com/auth/spreadsheets so you need to copy and paste code manually.

@mpurnell1
Copy link

I also encountered this issue but was having to re-authorize my application every few days. I originally tried to use Google Workspaces as a workaround to the Testing status, because a workspace app can be marked as internal. This did not work as expected, and I didn't want to publish my app because it only needs access to a few documents owned by me.

My solution was to use a service account to authorize instead of OAuth. I followed the steps in this post and made sure to share the sheet I wanted to edit with the service account, then I was able to update my spreadsheets fully automatically, without having to follow the link or paste an authorization code.

@francot
Copy link
Author

francot commented Sep 6, 2023

Thanks for your workaround. Actually I have published my app to avoid re-authorize every 7 days.
Issue remains valid for published/production app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants