Skip to content

Commit

Permalink
fix: oauth config access and auth (#145)
Browse files Browse the repository at this point in the history
Closes #146

This fixes a bug related to accessing auth configs for oauth credentials
and how they are used by the google packages. I was able to sync data
using these oauth credentials locally.
  • Loading branch information
pnadolny13 authored Jul 25, 2023
1 parent b6a0f55 commit a7824ad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tap_google_analytics/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from google.oauth2 import service_account

# Service Account - Google Analytics Authorization
from google.oauth2.service_account import Credentials as OAuthCredentials
from google.oauth2.credentials import Credentials as OAuthCredentials
from singer_sdk import Stream, Tap
from singer_sdk import typing as th # JSON schema typing helpers

Expand Down Expand Up @@ -97,10 +97,10 @@ class TapGoogleAnalytics(Tap):
def _initialize_credentials(self):
if self.config.get("oauth_credentials"):
return OAuthCredentials(
None,
refresh_token=self.config["refresh_token"],
client_id=self.config["client_id"],
client_secret=self.config["client_secret"],
token=self.config["oauth_credentials"]["access_token"],
refresh_token=self.config["oauth_credentials"]["refresh_token"],
client_id=self.config["oauth_credentials"]["client_id"],
client_secret=self.config["oauth_credentials"]["client_secret"],
token_uri="https://accounts.google.com/o/oauth2/token",
)
elif self.config.get("key_file_location"):
Expand Down

0 comments on commit a7824ad

Please sign in to comment.