Skip to content

Feat/OIDC discovery#200

Open
TharunvenkateshN wants to merge 5 commits into
roshankumar0036singh:mainfrom
TharunvenkateshN:feat/oidc-discovery
Open

Feat/OIDC discovery#200
TharunvenkateshN wants to merge 5 commits into
roshankumar0036singh:mainfrom
TharunvenkateshN:feat/oidc-discovery

Conversation

@TharunvenkateshN

Copy link
Copy Markdown
Contributor

Description

Closes #170

This PR introduces the OpenID Connect (OIDC) Discovery Endpoint to allow standard OIDC clients (like NextAuth or Auth0 SDKs) to automatically configure authorization endpoints, token endpoints, and supported scopes without manual setup.

Note: This PR is based on the JWKS PR, as it relies on exposing the JWKS URI.

Changes Made

  • OIDC DTO: Created OIDCDiscoveryResponse struct in internal/dto/oidc_discovery.go to map OIDC configuration fields.
  • Discovery Handler: Added internal/handler/oidc_discovery_handler.go which dynamically constructs absolute URLs for the Authorization, Token, UserInfo, and JWKS endpoints based on the active server's base URL (cfg.App.URL).
  • Route Registration: Exposed the OIDC discovery metadata payload at GET /.well-known/openid-configuration.

How to Test

  1. Start the server.
  2. Navigate to http://localhost:3000/.well-known/openid-configuration.
  3. Verify that the JSON response is standards-compliant and correctly points to the active server's absolute URL for all endpoints.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@TharunvenkateshN, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 minutes and 50 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: be4c30e2-a163-4944-bfa4-277480d18b14

📥 Commits

Reviewing files that changed from the base of the PR and between f5d1fcf and a9ad0ba.

📒 Files selected for processing (17)
  • docs/docs.go
  • docs/swagger.json
  • docs/swagger.yaml
  • internal/config/config.go
  • internal/dto/jwks.go
  • internal/dto/oidc_discovery.go
  • internal/handler/auth_handler_protected_test.go
  • internal/handler/auth_handler_test.go
  • internal/handler/jwks_handler.go
  • internal/handler/oauth_handler_test.go
  • internal/handler/oidc_discovery_handler.go
  • internal/middleware/auth_test.go
  • internal/routes/routes.go
  • internal/service/security_phase1_test.go
  • internal/service/token_service.go
  • internal/service/token_service_test.go
  • internal/testutils/setup.go
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

@TharunvenkateshN

Copy link
Copy Markdown
Contributor Author

I have read the CLA and agree to its terms.

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.

OpenID Connect Discovery Endpoint

1 participant