Skip to content

Support sub in userinfo field#45

Open
FerdinandvHagen wants to merge 1 commit intooauth2-proxy:mainfrom
unsafesystems:main
Open

Support sub in userinfo field#45
FerdinandvHagen wants to merge 1 commit intooauth2-proxy:mainfrom
unsafesystems:main

Conversation

@FerdinandvHagen
Copy link
Copy Markdown

The Subject (sub) field is not returned on userinfo requests.
According to https://connect2id.com/products/server/docs/api/userinfo#claims this is required.

Added the Subject field and wired it like the other fields.

@hut8
Copy link
Copy Markdown

hut8 commented Sep 25, 2023

This looks great - anything I can do to help it get merged?

sargunv added a commit to sargunv/horologia that referenced this pull request Mar 30, 2026
## Summary

- Add 8 integration tests for the full OIDC callback flow using
`mockoidc`
- Fix production bug: normalize token type casing (`tokens.Type()`
instead of `tokens.TokenType`) per RFC 6750
- Extend `setupTestServer` with functional options to support
OIDC-enabled test environments
- Work around mockoidc's missing `sub` claim in userinfo (upstream [PR
#45](oauth2-proxy/mockoidc#45))

## Test plan

- [x] All 8 OIDC tests pass: new user, returning user, email auto-link,
subject update, email unverified, missing email, redirect preserved,
malicious redirect ignored
- [x] All existing tests pass (no regressions from `setupTestServer`
signature change)
- [x] `mise run check` passes (golangci-lint, dprint, gomod-tidy, etc.)

Closes SV-38

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants