RedPlanetHQ / RedPlanetHQ/core

OAuth2 /oauth/userinfo response does not match committed OpenAPI UserInfo schema

Open
#968 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
2k
Forks
194
Avg merge
12m
Merged PRs (30d)
2

Description

Summary

The committed OpenAPI spec documents a UserInfo schema for GET /oauth/userinfo, but the live handler returns a different field set and naming convention.

Expected (OpenAPI)

docs/openapi.jsoncomponents.schemas.UserInfo:

  • id (string)
  • email (string)
  • name (string)
  • picture (string, uri)

GET /oauth/userinfo response is documented as #/components/schemas/UserInfo.

Actual (runtime)

apps/webapp/app/routes/oauth.userinfo.tsx calls oauth2Service.getUserInfo(), which returns:

{
  "sub": "<user id>",
  "email": "<email>",
  "name": "<name>",
  "display_name": "<displayName>",
  "avatar_url": "<avatarUrl>",
  "email_verified": true
}

(apps/webapp/app/services/oauth2.server.ts, getUserInfo)

Notes

  • Avatar data exists on the user model as User.avatarUrl (apps/webapp/prisma/schema.prisma), not picture.
  • ID tokens can include a picture claim (mapped from avatarUrl when profile scope is granted), but the userinfo endpoint does not return picture or id.
  • OAuth2/OIDC clients generated from the committed spec will expect fields the endpoint does not provide.

Suggested fix

Either:

  1. Update getUserInfo() to match the OpenAPI schema (id, picture, etc.), or
  2. Update docs/openapi.json to document the actual response (sub, avatar_url, display_name, email_verified, …).

Impact

Contract/documentation drift for OAuth2 integrators; SDKs and conformance tests built from the spec will not match production behavior.


Detected via cross-layer static analysis (DriftLens) against a shallow clone; please verify on current main.

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.

Research direction

Verify the current behavior in apps/webapp/app/routes/oauth.userinfo.tsx and apps/webapp/app/services/oauth2.server.ts, then compare it with components.schemas.UserInfo in docs/openapi.json and User.avatarUrl in apps/webapp/prisma/schema.prisma. Decide which contract is authoritative with the maintainer, then update the implementation or specification so the documented and live response fields match.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, typescript
Domain
api, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.