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

use a wrong token to api , errors are follows , can you tell me what is wrong?How to response correct? #83

Open
yangjinghit opened this issue Oct 14, 2021 · 1 comment

Comments

@yangjinghit
Copy link

yangjinghit commented Oct 14, 2021

flask version >=2.0.0
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1704, in make_response
rv = self.response_class.force_type(rv, request.environ) # type: ignore # noqa: B950
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/wrappers/response.py", line 263, in force_type
response = Response(*run_wsgi_app(response, environ))
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/test.py", line 1231, in run_wsgi_app
app_rv = app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/exceptions.py", line 221, in call
response = t.cast("WSGIResponse", self.get_response(environ))
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/exceptions.py", line 209, in get_response
headers = self.get_headers(environ, scope)
TypeError: get_headers() takes from 1 to 2 positional arguments but 3 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 2051, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1502, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1521, in finalize_request
response = self.make_response(rv)
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1711, in make_response
).with_traceback(sys.exc_info()[2])
File "/usr/local/python3/lib/python3.7/site-packages/flask/app.py", line 1704, in make_response
rv = self.response_class.force_type(rv, request.environ) # type: ignore # noqa: B950
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/wrappers/response.py", line 263, in force_type
response = Response(*run_wsgi_app(response, environ))
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/test.py", line 1231, in run_wsgi_app
app_rv = app(environ, start_response)
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/exceptions.py", line 221, in call
response = t.cast("WSGIResponse", self.get_response(environ))
File "/usr/local/python3/lib/python3.7/site-packages/werkzeug/exceptions.py", line 209, in get_response
headers = self.get_headers(environ, scope)
TypeError: get_headers() takes from 1 to 2 positional arguments but 3 were given
The view function did not return a valid response. The return type must be a string, dict, tuple, Response instance, or WSGI callable, but it was a _HTTPException.

flask == 1.1.4
{"error": "invalid_token", "error_description": "The access token provided is expired, revoked, malformed, or invalid for other reasons."}

what is the difference??

@voldikss
Copy link

voldikss commented Jan 4, 2022

Upgrade authlib

pip install authlib --upgrade

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

2 participants