orcasgit / python-nokia

Library for the Nokia Health API
Other
57 stars 23 forks source link

Invalid scope error on saveconfig #22

Open aluttik opened 6 years ago

aluttik commented 6 years ago

Am I doing something wrong? I'm having trouble saving my app's credentials.

macOS 10.13.6 Python 2.7.15

(venv)$ pip freeze
arrow==0.12.1
backports.functools-lru-cache==1.5
certifi==2018.8.24
chardet==3.0.4
cheroot==6.5.2
CherryPy==17.3.0
contextlib2==0.5.5
idna==2.7
jaraco.functools==1.20
more-itertools==4.3.0
nokia==1.0.0
oauthlib==2.1.0
portend==2.3
python-dateutil==2.7.3
pytz==2018.5
requests==2.19.1
requests-oauth==0.4.1
requests-oauthlib==1.0.0
six==1.11.0
tempora==1.13
urllib3==1.23
zc.lockfile==1.3.0
(venv)$ nokia saveconfig --client-id=XXX --consumer-secret=YYY --userid=ZZZ --callback-uri=http://localhost:7071 --config=nokia.cfg
Missing authentification information!
Starting authentification process...
Traceback (most recent call last):
  File "/Users/Arie/.pyenv/versions/2.7.15/bin/nokia", line 6, in <module>
    exec(compile(open(__file__).read(), __file__, 'exec'))
  File "/Users/Arie/aluttik/python-nokia/bin/nokia", line 143, in <module>
    server.browser_authorize()
  File "/Users/Arie/aluttik/python-nokia/bin/nokia", line 46, in browser_authorize
    url = self.auth.get_authorize_url()
  File "/Users/Arie/aluttik/python-nokia/nokia/__init__.py", line 79, in get_authorize_url
    '%s/oauth2_user/authorize2'%self.URL
  File "/Users/Arie/.pyenv/versions/2.7.15/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py", line 153, in authorization_url
    **kwargs), state
  File "/Users/Arie/.pyenv/versions/2.7.15/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/clients/web_application.py", line 86, in prepare_request_uri
    redirect_uri=redirect_uri, scope=scope, state=state, **kwargs)
  File "/Users/Arie/.pyenv/versions/2.7.15/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 79, in prepare_grant_uri
    params.append(('scope', list_to_scope(scope)))
  File "/Users/Arie/.pyenv/versions/2.7.15/lib/python2.7/site-packages/oauthlib/oauth2/rfc6749/utils.py", line 32, in list_to_scope
    raise ValueError("Invalid scope (%s), must be string, tuple, set, or list." % scope)
ValueError: Invalid scope (user.info,user.metrics,user.activity), must be string, tuple, set, or list.