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

Error text on invalid scope is overly verbose #32

Open
ScottWeinstein opened this issue May 8, 2019 · 0 comments
Open

Error text on invalid scope is overly verbose #32

ScottWeinstein opened this issue May 8, 2019 · 0 comments

Comments

@ScottWeinstein
Copy link
Contributor

Describe the problem.
The error text if your application account doen't have the correct scope is too verbose

> python .\sample.py
Traceback (most recent call last):
  File ".\sample.py", line 14, in <module>
    with GsSession.get(Environment.PROD, CLIENTID, SECRET, scopes=('read_product_data', 'run_analytics')):
  File "C:\Users\scott\AppData\Roaming\Python\Python37\site-packages\gs_quant\context_base.py", line 67, in __enter__
    self._on_enter()
  File "C:\Users\scott\AppData\Roaming\Python\Python37\site-packages\gs_quant\session.py", line 81, in _on_enter
    self.init()
  File "C:\Users\scott\AppData\Roaming\Python\Python37\site-packages\gs_quant\session.py", line 92, in init
    self._authenticate()
  File "C:\Users\scott\AppData\Roaming\Python\Python37\site-packages\gs_quant\session.py", line 270, in _authenticate
    raise MqAuthenticationError(reply.status_code, reply.text, context=self.auth_url)
gs_quant.errors.MqAuthenticationError: context: https://idfs.gs.com/as/token.oauth2
status: 400, message: {"error_description":"The requested scope(s) must be blank or a subset of the provided scopes.","error":"invalid_scope"}

Describe the solution you'd like
The message should be - "your application account needs the following scopes X,Y,Z to invoke the APIs you used. Request scopes at URL"

Are you willing to contribute
No

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

1 participant