Giter Club home page Giter Club logo

oauthcli's People

Contributors

vklimontovich avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oauthcli's Issues

Running oauthcli error

Hello,

I'm trying to use Google Sheets source with Jitsu.
I followed the step you provide to add a new OAuth credential with :

  • Google Sheets API activated
  • Google Drive API activated
  • Desktop as type of application for ID Client Auth

But i keep struggling with this error.

./authorizer.py --client_id=<CLIENT_ID> --client_secret=<CLIENT_SECRET> --scope='https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/spreadsheets.readonly'


Started runner
In start loop
 * Serving Flask app "authorizer" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
127.0.0.1 - - [26/Aug/2022 11:14:35] "GET / HTTP/1.1" 200 -
Server started, quiting start_loop
{
    "access_token": "<ACCESS_TOKEN>",
    "expires_in": 3599,
    "refresh_token": "<REFRESH_TOKEN>",
    "scope": "https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/spreadsheets.readonly",
    "token_type": "Bearer"
}
[2022-08-26 11:14:41,236] ERROR in app: Exception on /oauth [GET]
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1974, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'dict' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1816, in full_dispatch_request
    return self.finalize_request(rv)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1831, in finalize_request
    response = self.make_response(rv)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1982, in make_response
    reraise(TypeError, new_error, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/flask/_compat.py", line 34, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/flask/app.py", line 1974, in make_response
    rv = self.response_class.force_type(rv, request.environ)
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 269, in force_type
    response = BaseResponse(*_run_wsgi_app(response, environ))
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/wrappers/base_response.py", line 26, in _run_wsgi_app
    return _run_wsgi_app(*args)
  File "/home/antoine/.local/lib/python3.7/site-packages/werkzeug/test.py", line 1119, in run_wsgi_app
    app_rv = app(environ, start_response)
TypeError: 'dict' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a dict.
127.0.0.1 - - [26/Aug/2022 11:14:41] "GET /oauth?code=<CODE>&scope=https://www.googleapis.com/auth/drive.metadata.readonly%20https://www.googleapis.com/auth/spreadsheets.readonly HTTP/1.1" 500 -

I get a refresh_token but keep can't configure it into jitsu/configurator

Error singer --discover: exit status 1. INFO Authorized, token expires = 2022-08-26 10:20:07.648486 INFO Starting discover INFO spreadsheet_metadata URL = https://sheets.googleapis.com/v4/spreadsheets/1iiTUVeaHfKBY1FEBdiURVWWFsSXKMWyY4KmEYfI1ygc?includeGridData=false INFO METRIC: {"type": "timer", "metric": "http_request_duration", "value": 0.31192994117736816, "tags": {"endpoint": "spreadsheet_metadata", "http_status_code": 403, "status": "succeeded"}} CRITICAL HTTP-error-code: 403 {'code': 403, 'message': 'Request had insufficient authentication scopes.', 'status': 'PERMISSION_DENIED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'service': 'sheets.googleapis.com', 'method': 'google.apps.sheets.v4.SpreadsheetsService.GetSpreadsheet'}}]}: Unknown Error Traceback (most recent call last): File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/client.py", line 111, in raise_for_error response.raise_for_status() File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/requests/models.py", line 940, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://sheets.googleapis.com/v4/spreadsheets/1iiTUVeaHfKBY1FEBdiURVWWFsSXKMWyY4KmEYfI1ygc?includeGridData=false&includeGridData=false During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/eventnative/data/venv/tap-google-sheets/bin/tap-google-sheets", line 11, in <module> load_entry_point('tap-google-sheets==1.3.1', 'console_scripts', 'tap-google-sheets')() File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/singer/utils.py", line 229, in wrapped return fnc(*args, **kwargs) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/__init__.py", line 51, in main do_discover(client, spreadsheet_id) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/__init__.py", line 26, in do_discover catalog = discover(client, spreadsheet_id) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/discover.py", line 10, in discover schemas, field_metadata = stream_object.get_schemas() File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/streams.py", line 310, in get_schemas spreadsheet_md_results = self.client.get(path=path, params=querystring, api=api, endpoint=self.stream_name) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/client.py", line 266, in get return self.request(method='GET', path=path, api=api, **kwargs) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/backoff/_sync.py", line 94, in retry ret = target(*args, **kwargs) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/backoff/_sync.py", line 94, in retry ret = target(*args, **kwargs) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/singer/utils.py", line 95, in wrapper return func(*args, **kwargs) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/client.py", line 260, in request raise_for_error(response) File "/home/eventnative/data/venv/tap-google-sheets/lib/python3.9/site-packages/tap_google_sheets/client.py", line 128, in raise_for_error raise ex(message) tap_google_sheets.client.GoogleForbiddenError: HTTP-error-code: 403 {'code': 403, 'message': 'Request had insufficient authentication scopes.', 'status': 'PERMISSION_DENIED', 'details': [{'@type': 'type.googleapis.com/google.rpc.ErrorInfo', 'reason': 'ACCESS_TOKEN_SCOPE_INSUFFICIENT', 'domain': 'googleapis.com', 'metadata': {'service': 'sheets.googleapis.com', 'method': 'google.apps.sheets.v4.SpreadsheetsService.GetSpreadsheet'}}]}: Unknown Error (#400)

Do you have any idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.