Token response includes non-standard "user" PII field (resolves existing TODO)
Nobody has claimed this yet.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 88/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python
- Domain
- api, authentication
Research direction
Open app/oauth/views/token.py at the token endpoint response around line 82 and review the existing TODO. Remove the non-standard user field, then verify the response contains only the appropriate OAuth token fields and that user information remains available through the /oauth2/userinfo endpoint.
Written by the indexing model from the issue text.
Description
Describe the bug
The token endpoint response includes a non-standard "user" field containing personally identifiable information (PII) such as the user's email, name, and ID:
# app/oauth/views/token.py line 82
res = {
"access_token": oauth_token.access_token,
"token_type": "Bearer",
"expires_in": 3600,
"scope": auth_code.scope,
"user": user_data, # todo: remove this
}
Per RFC 6749 Section 5.1, the standard token response fields are strictly limited to access_token, token_type, expires_in, refresh_token, and scope. Including PII in the token response means that any party or network observer that can see the token exchange will also receive the user's PII, even if they only requested an access token.
The inline comment # todo: remove this indicates this was already identified as technical debt to be cleaned up.
Expected behavior
Remove the "user" field from the token response dictionary. Clients requiring user information should fetch it via the standard /oauth2/userinfo endpoint using the issued access token.
Additional context
File: app/oauth/views/token.py line 82.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 650
- Avg merge
- 18h 53m
- Merged PRs (30d)
- 9
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from simple-login/app
-
Bug: forwarded emails with quoted-printable body are corrupted in strict MIME clients (Outlook) Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
simple-login/app#2758 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
simple-login/app#2754 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
simple-login/app#2752 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
simple-login/app#2750 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
simple-login/app#2807 ·
All issues in simple-login/app
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100