Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概述
支持基于 Spring Security OAuth2 Client 的 OIDC 登录,复用现有 OAuth 准入、身份绑定和会话建立链路。
变更内容
后端实现
CustomOidcUserService,将 OIDCsub、email、email_verified、preferred_username、name、picture归一化为现有OAuthClaimsSecurityConfig的oauth2Login().userInfoEndpoint()中接入oidcUserServiceOAuthLoginFlowService.authenticate(OAuthClaims),让 OAuth2 与 OIDC 共用AccessPolicy和IdentityBindingService前端实现
/api/v1/auth/methods作为OAUTH_REDIRECT登录方式暴露,登录页现有 OAuth 区域自动渲染入口测试覆盖
CustomOidcUserServiceTest,覆盖 OIDC claims 映射、头像字段同步、平台角色注入和 fallback 登录名web/src/**/*.ts(x)变更,未触发 Playwright E2E 要求质量门禁
make typecheck-web不适用(无前端变更)make lint-web不适用(无前端变更)make test-frontend不适用(无前端变更)make test-backend-app通过make generate-api不适用(无 Controller 变更)安全考虑
AccessPolicy判断开放、域名、provider allowlist 或 subject whitelistidentity_binding(provider_code, subject),无需新增表结构PlatformSessionService处理相关 Issue
Closes #315
测试说明
本地验证步骤
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_ID、SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRET、SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_ISSUER_URImake dev-all/login,在 OAuth tab 查看 OIDC 登录入口/oauth2/authorization/oidc并由后端处理/login/oauth2/code/oidc回调回归测试范围
/api/v1/auth/methods截图/录屏(如有 UI 变更)
无 UI 变更。