I am making a server side web app that integrates with Google Drive's "Open With" button. I've been able to get a refresh token with the InstalledAppFlow in the python client library (go to my install endpoint redirect user to consent screen and google uses the redirect_uri to send the code to my server) and access the data I want.
What I don't understand now is how do I get a refresh token after a user installs and consents to the permissions requested by my app in the GSuite marketplace? Does Google post the information to one of the redirect URIs of your OAuth2.0 client Ids? Do I have to ask the user for consent again and get the refresh token as before when he uses "Open With" from Google Drive?
Its not clear to me how the oauth flow works with apps installed through the GSuite Marketplace. Thanks for any help!
I've figured out my problem. What I was looking for doesn't exist. Google doesn't already generate credentials when the app is installed from the G-Suite marketplace, unless you use a service account. Presumably you have to authorize the user yourself the first time he uses your app.