Support for the GET /oauth/authorize is broken - returns 500

Open
#90 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
flask, python

Research direction

Start with website/routes.py, especially the authorize route at line 101, and reproduce the failure by running the example with flask run before requesting GET /oauth/authorize. Trace the AuthorizationServer API used there and compare it with the example's installed Authlib version. Done means the authorization endpoint no longer raises AttributeError and the documented OAuth flow can be exercised successfully.

Written by the indexing model from the issue text.

Description

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'
Dominant language
Python
Stars
705
Forks
279
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from authlib/example-oauth2-server

All issues in authlib/example-oauth2-server

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.