Add generic OpenID Connect external auth provider #6
Loading…
Reference in a new issue
No description provided.
Delete branch "d/oidc-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
🤖 Claude AI Code Review
Summary
Adds a generic OIDC external auth provider with PKCE, group-to-role mapping, and discovery-based configuration. Clean integration into the existing OAuth extension pattern.
Code Quality ⭐⭐⭐⭐☆
Well-documented, sensible defaults, and thoughtful handling of userinfo claim quirks across IdPs.
Issues
🟡 OAuthBlazorExtensions.cs —
AddOpenIdConnectAuthregistersservices.AddSingleton(oidcOptions)asOpenIdConnectAuthOptions, but calling it twice (multiple OIDC providers, which the docs explicitly encourage via unique schemes) will overwrite the singleton.MapOAuthEndpointsonly resolves a singleOpenIdConnectAuthOptions, so only the last-registered provider gets endpoints mapped. Either document single-provider only, or key the registration by scheme.🟢 OpenIdConnectAuthOptions.cs —
ClientSecretcan be null/empty with no validation; onlyAuthorityis checked. For confidential clients using code flow this will fail at runtime with a less clear error. Minor, since public clients with PKCE are valid.🟢 OAuthBlazorExtensions.cs —
RoleClaimType/NameClaimTypeare set onTokenValidationParameters, but groups come from the userinfo endpoint (GetClaimsFromUserInfoEndpoint = true), not the id_token. TheClaimActions.MapJsonKeyhandles that mapping, so this is fine — just confirm groups actually land as expected given both paths are configured.Verdict: REQUEST CHANGES
📊 Tokens: 5631 input + 654 output | 💰 Cost: ~$0.0445
Generated by Claude Opus 4.8 via Gitea Actions