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

Unable to make credentials work for airbyte_destination_google_sheets terraform module #84

Open
anurag-sequoia opened this issue Feb 23, 2024 · 0 comments

Comments

@anurag-sequoia
Copy link

anurag-sequoia commented Feb 23, 2024

As per https://registry.terraform.io/providers/airbytehq/airbyte/latest/docs/resources/destination_google_sheets#configuration, the configuration requires a client_id, a client_secret and a refresh_token to work. I have tried using a desktop-app client-id (and secret and refresh token) as well as a web-app credentials but neither of them work. Note: for the desktop-app (ie installed app), I obtained the refresh-token programatically; for web-app I took it from oauth-playground (https://developers.google.com/oauthplayground).

from google_auth_oauthlib.flow import InstalledAppFlow

SCOPES = ['https://www.googleapis.com/auth/drive', 'https://www.googleapis.com/auth/spreadsheets']

flow = InstalledAppFlow.from_client_config(
    {
      "installed":{
        "client_id": <>,
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "token_uri":"https://oauth2.googleapis.com/token",
        "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs",
        "client_secret": <>,
        }}, SCOPES)
creds = flow.run_local_server(port=0)
print(creds.refresh_token)

The airbyte destination works fine once I 'reauthenticate' from the UI manually.

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

1 participant