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

Why using "access_token" when the authentication method is API Token? #126

Open
mfs-homero-merino opened this issue May 6, 2023 · 3 comments

Comments

@mfs-homero-merino
Copy link

for page in http.get_incremental_export(url, self.config['access_token'], self.request_timeout, start_time):

My team is trying to use this tap with the API token authenticationn but when running ~/.virtualenv/tap-zendesk/bin/tap-zendesk --config tap-zendesk.conf --catalog catalog_zendesk.json, we're getting this error:
INFO Using API Token authentication.
INFO tickets: Starting sync
INFO Syncing ticket_audits per ticket...
INFO METRIC: {"type": "counter", "metric": "record_count", "value": 0, "tags": {"endpoint": "tickets"}}
CRITICAL 'access_token'
Traceback (most recent call last):
File "/home/singer/.virtualenv/tap-zendesk/bin/tap-zendesk", line 33, in
sys.exit(load_entry_point('tap-zendesk==1.7.5', 'console_scripts', 'tap-zendesk')())
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/singer/utils.py", line 229, in wrapped
return fnc(*args, **kwargs)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/init.py", line 214, in main
do_sync(client, parsed_args.catalog, state, parsed_args.config)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/init.py", line 144, in do_sync
counter_value = sync_stream(state, config.get('start_date'), instance)
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/sync.py", line 31, in sync_stream
for (stream, record) in instance.sync(state):
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/streams.py", line 330, in sync
for ticket in tickets:
File "/home/singer/.virtualenv/tap-zendesk/lib/python3.9/site-packages/tap_zendesk/streams.py", line 151, in get_objects
for page in http.get_incremental_export(url, self.config['access_token'], self.request_timeout, start_time):
KeyError: 'access_token'

The get_objects method in CursorBasedExportStreams class uses again the config file regardless of the authentication type which causes an error in the keys. If both keys are added in config file, by default the auth method selected is Oauth.

Any suggestion for this error? Kind regards!

@mfs-homero-merino
Copy link
Author

image

@dmnpignaud
Copy link

This PR solves the problem but it has been closed for no obvious reason.

@bdewilde
Copy link

I just ran into this error myself. Definitely unexpected behavior to claim support for the API token approach to authorization, but then require OAuth under the hood.

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

3 participants