authlib / authlib/example-oauth2-server
Support for the GET /oauth/authorize is broken - returns 500
- Lenguaje dominante
- Python
- Estrellas
- 705
- Forks
- 279
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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'
~~~
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con website/routes.py, especialmente con la ruta authorize en la línea 101, y reproduce el fallo ejecutando el ejemplo con flask run antes de solicitar GET /oauth/authorize. Sigue la API AuthorizationServer utilizada allí y compárala con la versión instalada de Authlib del ejemplo. Se considera terminado cuando el endpoint de autorización ya no genera AttributeError y el flujo OAuth documentado se puede ejecutar correctamente.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- flask, python
- Área
- authentication, backend
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100