feat(auth): support standard CAS 2.0/3.0 SSO protocol
Maintainers usually reply within 1 day
Nobody has claimed this yet.
- #464 by @dongmucat — closed without merging
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Quiet
- Domain
- api, authentication, backend
Research direction
Read the existing IdentityBindingService, OAuthLoginRedirectSupport, and RouteSecurityPolicyRegistry, then trace the current OAuth login flow and the closed PRs #444 and #464. The issue lists the planned CAS properties, ticket validator, controller, claims adapter, runtime config, tests, and deployment documentation. Done means standard CAS 3.0 JSON login works with CAS 2.0 XML fallback, identity binding and return URL handling are reused, and the feature is disabled by default.
Written by the indexing model from the issue text.
Description
背景
在 #444 的 review 中,我们决定不合并基于私有协议的 SSO 实现,转而支持标准 CAS 2.0/3.0 协议,使 OSS 用户可以对接 Apereo CAS Server、Keycloak CAS adapter 等主流实现。
关联 PR:#444(已关闭)
目标
实现标准 CAS 2.0/3.0 协议的 SSO 登录集成,复用现有 IdentityBindingService 身份映射抽象。
设计要点
协议支持
- CAS 2.0:
GET /serviceValidate?ticket=...&service=...→ XML 响应 - CAS 3.0:
GET /p3/serviceValidate?ticket=...&service=...&format=JSON→ JSON 响应 - 优先实现 3.0 JSON 模式,兼容 2.0 XML fallback
架构原则
- 复用
IdentityBindingService:将 CAS attributes 适配为通用IdentityClaims(需先将IdentityBindingService.bindOrCreate的入参从OAuthClaims抽象为 provider-neutral 接口) - 复用
OAuthLoginRedirectSupport.sanitizeReturnTo():防止 open redirect - HTTPS 强校验:
@PostConstruct校验 CAS server URL 必须为 HTTPS(或提供显式 escape hatch 用于开发环境) - Feature flag:默认 disabled,通过
skillhub.auth.cas.enabled=true启用
配置项(初步)
skillhub:
auth:
cas:
enabled: false
server-url: https://cas.example.com # CAS server base URL
service-url: https://skillhub.example.com/api/v1/auth/cas/callback
protocol-version: 3.0 # 2.0 | 3.0
attributes:
username: uid # CAS attribute → platform username
display-name: cn # CAS attribute → display name
email: mail # CAS attribute → email (optional)
前端
- 登录页新增"CAS 登录"按钮,由 runtime config
authCasEnabled控制显隐 - 复用 #444 中
SsoLoginEntry的 UI 模式
实现步骤
- 重构:将
IdentityBindingService.bindOrCreate(OAuthClaims)抽象为IdentityClaims接口,OAuth 和 CAS 各自实现 - 后端:
CasProperties配置类 +@PostConstruct校验 - 后端:
CasTicketValidator(GET serviceValidate,解析 XML/JSON) - 后端:
CasLoginController(/login 重定向 + /callback 票据验证) - 后端:
CasIdentityClaims适配器,调用IdentityBindingService - 后端:
RouteSecurityPolicyRegistry放行/api/v1/auth/cas/** - 前端:
CasLoginEntry组件 + runtime config - 前端:
30-runtime-config.sh添加SKILLHUB_WEB_AUTH_CAS_ENABLED - 测试:CasTicketValidator 单测(mock XML/JSON 响应)
- 测试:CasLoginController 单测(redirect / callback / error)
- 文档:部署文档补充 CAS 配置说明
参考
备注
- 如果内部部署需要对接非标准 CAS 协议(如讯飞内部 SSO 网关),建议作为独立私有模块维护,不进 OSS 主干
- 可考虑直接使用
spring-security-cas模块,但需评估与现有PlatformSessionService的集成成本
- Dominant language
- Java
- Stars
- 5.2k
- Forks
- 841
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 77
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from iflytek/skillhub
-
effort/l priority/p2 risk/high triage/deferred
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
iflytek/skillhub#1039 · 1 comment ·
Maintainers usually reply within 1 day
-
effort/l priority/p2 risk/high triage/deferred
Difficulty 3/5 1-2 days Newbie friendliness 57/100
iflytek/skillhub#1036 · 2 comments ·
Maintainers usually reply within 1 day
-
[Feature] 面向非技术用户的 skill 展示:中文展示名/简介/能力说明 + 首页推荐板块Possibly taken @XiaoSeS claimed this 1 day ago. Openeffort/l priority/p1 risk/high triage/core
iflytek/skillhub#1035 · 4 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
[Feature] RFC:默认关闭的厂商中立后端业务事件出口 / Opt-in backend business-event exportPossibly taken @xiaoyaner0201 claimed this 2 days ago. Openeffort/l priority/p1 risk/high triage/core
Difficulty 5/5 Over a week Newbie friendliness 25/100
iflytek/skillhub#1009 · 2 comments ·
Maintainers usually reply within 1 day
-
[Feature] DSH 技能中心扩展路线图:场景助手、技能使用与管理、项目复用及自动化Possibly taken @XiaoSeS claimed this 9 days ago. Openeffort/m enhancement priority/p2 triage/deferred
iflytek/skillhub#998 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in iflytek/skillhub
Similar issues
-
bug/错误
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
FCL-Team/FoldCraftLauncher#1982 · 2 comments ·
Maintainers usually reply within 1 day
-
[BUG] micronaut-serde-oracle-jdbc-json brings a second OJDBC driver onto the runtime classpathPossibly taken @ZARAYACH claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
micronaut-projects/micronaut-serialization#1494 · 4 comments ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
Maintainers usually reply within 2 days
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vitruv-tools/Vitruv-Change#600 ·
Maintainers usually reply within 1 day
-
code-health feature/sync OS/Android QA/Test-Plan-Specified QA/Yes
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
brave/brave-browser#60327 ·
Maintainers usually reply within 1 day