Skip to content

feat(auth): OIDC compliance improvements#2270

Open
jackmaninov wants to merge 1 commit into
cortezaproject:2024.9.xfrom
jackmaninov:oidc-clean
Open

feat(auth): OIDC compliance improvements#2270
jackmaninov wants to merge 1 commit into
cortezaproject:2024.9.xfrom
jackmaninov:oidc-clean

Conversation

@jackmaninov
Copy link
Copy Markdown

Summary

This PR improves OIDC (OpenID Connect) compliance for Corteza's OAuth2/OIDC implementation:

  • UserInfo endpoint (/auth/oauth2/userinfo): Implements OIDC Core 1.0 Section 5.3 compliant endpoint that returns user claims based on token scopes (openid, profile, email)
  • Discovery document: Adds spec-compliant mount point at /auth/.well-known/openid-configuration (the original /.well-known/openid-configuration is preserved for backward compatibility)
  • Silent authentication (prompt=none): Implements OIDC Core 1.0 Section 3.1.2.1 for silent authentication flows, returning appropriate login_required or interaction_required errors
  • Enhanced discovery metadata: Adds userinfo_endpoint, claims_supported, and scopes_supported to the discovery document

Related Issues

Test Plan

  • Added comprehensive tests for UserInfo endpoint (7 test cases covering full claims, scope filtering, error handling)
  • Added tests for prompt=none error redirects (4 test cases)
  • Added tests for UserID serialization
  • All existing tests pass

Breaking Changes

None. The original /.well-known/openid-configuration endpoint is preserved for backward compatibility.

🤖 Generated with Claude Code

Implements several improvements to make Corteza more compliant with
OpenID Connect specifications:

1. OIDC-compliant userinfo endpoint
   - Add /auth/oauth2/userinfo endpoint returning standard OIDC claims
   - Support both GET and POST methods per OIDC spec
   - Return proper Content-Type: application/json

2. ID token claims fixes
   - Include 'sub' claim (subject identifier) in ID tokens
   - Add 'email' and 'email_verified' claims
   - Add 'name' claim from user's display name/username

3. Silent authentication support
   - Implement prompt=none parameter for silent auth checks
   - Return proper OIDC error responses (login_required, etc.)
   - Enable refresh token flows without user interaction

4. Discovery endpoint path fix
   - Mount .well-known/openid-configuration at /auth path
   - Ensure issuer URL matches discovery endpoint location
   - Fix OIDC client library compatibility

Includes comprehensive tests for the userinfo endpoint and prompt=none
error handling.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@jackmaninov
Copy link
Copy Markdown
Author

Same story as my previous PR, this was written with claude-code but has been heavily tested on my production environment. Could probably use some sanity testing with a client other than go-oidc.

@Fajfa
Copy link
Copy Markdown
Member

Fajfa commented Jan 5, 2026

Oh wow, thanks for the contribution, will be reviewed and merged if all is good.

@Fajfa Fajfa requested a review from tjerman January 5, 2026 08:20
@Fajfa Fajfa added this to the 2024.9.8 milestone Jan 8, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 1, 2026

Stale pull request message

@Fajfa Fajfa modified the milestones: 2024.9.8, 2024.9.10 May 21, 2026
@Fajfa Fajfa force-pushed the 2024.9.x branch 2 times, most recently from b8536d1 to b7d6d27 Compare May 21, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants