Skip to content

feat(oauth2): add RFC 9207 iss parameter, Redis refresh token persistence, and RFC 6750 form bearer support - #396

Merged
voidvec merged 1 commit into
fix/security-and-rfc-hardeningfrom
feat/rfc-compliance-gap-a
Dec 2, 2026
Merged

voidvec merged 1 commit into
fix/security-and-rfc-hardeningfrom
feat/rfc-compliance-gap-a

Conversation

@voidvec

@voidvec voidvec commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • RFC 9207 (iss parameter): Advertise authorization_response_iss_parameter_supported: true in discovery metadata and append iss on all authorize success/error/consent redirects.
  • Redis Refresh Token Persistence: Implement full JSON serialization, oauth2:family:<familyId> index tracking, revocation retention, family revocation, and introspection fallback in RedisTokenRepository. Upgraded TokenRepositoryContractTest.cc to round-trip contract.
  • RFC 6750 §2.2 Form Bearer: Support access_token in application/x-www-form-urlencoded body for POST /oauth2/userinfo in OAuth2AuthFilter (GET query token remains rejected). Route registration & openapi.yaml SDK regeneration deferred to a follow-up PR with Go 1.22+.

Testing

  • Added tests/integration/token/RfcGapAFeaturesTest.cc (3 tests, 18 assertions).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T01:26:53.444491Z 2b00ebb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b00ebbf0e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
// OIDC Core 5.3.1 + RFC 6750 2.2: allow form-encoded body
// access_token on POST /oauth2/userinfo (never URL query params).
token = req->getParameter("access_token");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read the form bearer token exclusively from the request body

For a POST request with a form content type, getParameter("access_token") also reads URL query parameters; the same merged-parameter behavior is explicitly documented in libs/drogon/src/services/SocialLoginGuard.cc in parseBody(). Consequently, this branch accepts /oauth2/userinfo?access_token=... even when the form body contains no token, contrary to its stated body-only restriction. Parse the body separately and add a POST-with-query-token rejection test. The built-in userinfo route is currently GET-only, so this affects the new filter branch when invoked directly or mounted on a POST route.

Useful? React with 👍 / 👎.

Comment on lines +221 to +223
"EXPIRE %s %s",
famKey.c_str(),
ttlStr.c_str()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the longest expiration when updating the family index

When a family contains tokens with different expiration times, saving a shorter-lived token unconditionally resets the shared family set's TTL to that token's TTL. For example, saving a token expiring in one hour after a sibling expiring tomorrow deletes the index after one hour while the sibling remains valid. Subsequent revokeTokenFamily() calls find no members and leave that refresh token usable. Update the index expiration atomically so it never precedes the latest expiration of any indexed token.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant