authlib / authlib/example-oauth2-server
Support for the GET /oauth/authorize is broken - returns 500
- Lingua principale
- Python
- Stelle
- 705
- Fork
- 279
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Just using this example to explore the library, and hard to tell how things are supposed to fit together without docs or a (working) sample.
To reproduce the problem, just setup and run (flask run)
Verify
~~~
curl -u ${client_id}:${client_secret} -XPOST http://127.0.0.1:5000/oauth/token -F grant_type=password -F username=${username} -F password=${password} -F scope=profile
~~~
works fine/as expected.
Then try (from a web browser probably but thats what I was trying to figure out)
GET http://127.0.0.1:5000/oauth/authorize
Crashes cuz
~~~
,,,
File "/home/lewis/.local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "/mnt/c/Sandbox/SimoneOAuth2/example-oauth2-server/website/routes.py", line 101, in authorize
grant = authorization.get_consent_grant(end_user=user)
AttributeError: 'AuthorizationServer' object has no attribute 'get_consent_grant'
~~~
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia da website/routes.py, in particolare dalla route authorize alla riga 101, e riproduci il problema eseguendo l'esempio con flask run prima di richiedere GET /oauth/authorize. Traccia l'API AuthorizationServer utilizzata in quel punto e confrontala con la versione di Authlib installata per l'esempio. Il lavoro è completo quando l'endpoint di autorizzazione non solleva più AttributeError e il flusso OAuth documentato può essere eseguito correttamente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- flask, python
- Ambito
- authentication, backend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100