authlib / authlib/example-oauth2-server
use a wrong token to api , errors are follows , can you tell me what is wrong?How to response correct?
- Lingua principale
- Python
- Stelle
- 705
- Fork
- 279
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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??
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia riproducendo il comportamento segnalato con Flask 2.0 o versione successiva e confrontalo con Flask 1.1.4, usando il traceback e gli esempi di risposta del token come osservazioni attese. Segui il percorso di gestione degli errori che fallisce e determina quale comportamento debba essere preservato per un token non valido; il lavoro è completato quando la configurazione Flask più recente restituisce una risposta di errore corretta senza l’eccezione mostrata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- flask, python
- Ambito
- api, authentication, backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100