singer-io / tap-harvest

A Singer tap for extracting data from the Harvest API
GNU Affero General Public License v3.0
8 stars 13 forks source link

tap refreshes its own AT w/ a refresh_token and oauth client creds #12

Closed bi1yeu closed 6 years ago

bi1yeu commented 6 years ago

This change gives the tap the ability to refresh its own access token, which is desirable for two reasons:

Example run with good credentials:

$ tap-harvest -c harvest-config.json
  INFO Refreshing access token
  INFO Got refreshed access token
  INFO Starting sync
...

with bad credentials:

$ tap-harvest -c harvest-config.json
  INFO Refreshing access token
CRITICAL invalid_client
CRITICAL The client identifier provided is invalid, the client failed to authenticate, the client did not include its credentials, provided multiple client credentials, or used unsupported credentials type.
CRITICAL 'access_token'
...
KAllan357 commented 6 years ago

:+1: