oauthlib / oauthlib/oauthlib

Is the *request.client.client_id* attribute really necessairy?

Open
#389 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Breaking Discussion Documentation Todo
Dominant language
Python
Stars
3k
Forks
529
PR merge metrics
No merged PRs in 30d

Description

Hi,

thank you for this great library.

I implemented the request validator as described in the documentation, but I get this exception after executing the authenticate_client method:

Authenticate client must set the request.client.client_id attribute in authenticate_client.

https://github.com/idan/oauthlib/blob/master/oauthlib/oauth2/rfc6749/grant_types/authorization_code.py#L374

Is there a difference between request.client_id and request.client.client_id? I think the line of code should be

if not hasattr(request, 'client_id'):

Contributor guide

Open the contributing guide

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.

Research direction

Start at oauthlib/oauth2/rfc6749/grant_types/authorization_code.py around line 374 and compare the documented validator behavior with the request.client_id and request.client.client_id attributes described in the issue. Confirm which attribute the authenticate_client contract requires and verify the corrected behavior with the relevant authorization-code flow tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
authentication
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.