集成市场
Marketplace(应用市场)是一个现成集成的目录,您可以在 Casdoor 控制台中从中进行安装。无需手动创建应用或提供商并从指南中复制设置,您只需选择一个集成,填写几个值,Casdoor 就会为您创建相应的对象。卸载操作会再次移除这些对象,或恢复之前的状态。
在网络浏览器中访问 marketplace.casdoor.com 浏览目录。集成本身是开源的,位于 casdoor/casdoor-integrations。
Marketplace(应用市场)自 2026 年 10 月起包含在 Casdoor master 分支中,并在 v4.19.0 之后的每个版本中可用。Casdoor Cloud 实例已具备此功能。
可安装的内容
| Type | What installing it does | Examples |
|---|---|---|
| App integration | Creates an application with the redirect URLs, grant types and token format the app needs. The guide then shows the app's own settings with your Casdoor address, client ID and client secret filled in. | Grafana, GitLab, Nextcloud, Vaultwarden, Argo CD, Immich, Open WebUI, Portainer, Gitea, Proxmox VE |
| Identity provider | Creates a provider from a template, so your users can sign in to Casdoor with an identity system they already have. Optionally adds it to the sign-in page of an application. | Keycloak, authentik, ZITADEL, Authelia, GitLab Self-Managed |
| Sign-in theme | Replaces the look of the sign-in pages of one application: themeData, formOffset, formCss, formCssMobile, formSideHtml, footerHtml, formBackgroundUrl and formBackgroundUrlMobile (Background URL and Background URL Mobile). | Midnight, Split |
安装集成
- 在控制台中,打开 Identity → Marketplace(身份 → 应用市场)。按类型筛选或按名称搜索。
- 点击某个集成上的 Install(安装)。
- 填写表单:
- Organization(组织):安装该集成的目标组织。
- Name(名称):也是其创建的应用或提供商的名称,因此必须未被占用。仅限字母、数字、
-和_。 - 集成自身的变量,例如您的 Grafana URL 或 Keycloak realm。URL 必须以
http://或https://开头;颜色格式为#rrggbb。 - 对于身份提供商:您在另一端注册的客户端的 client ID(客户端 ID)和 client secret(客户端密钥),其重定向 URI 为
<your Casdoor address>/callback,以及可选的要添加该提供商的应用。 - 对于主题:应用该主题的登录页面的所属应用。对话框会实时预览应用了该主题的应用登录页面。空字段会使用示例值进行预览,且在您点击安装前不会发生任何更改。
- 点击 Install(安装)。
已安装的集成列在 Identity → Integrations(身份 → 集成)下。已安装集成的页面会显示其创建的对象以及在另一端的剩余设置步骤,其中您的 Casdoor 地址、client ID、client secret 和变量均已填充,可直接复制。
卸载
在 Identity → Integrations(身份 → 集成)下删除集成:
- App integration(应用集成):删除其创建的应用。用户将无法再通过 Casdoor 登录该应用。
- Identity provider(身份提供商):将其从其所在应用中移除,然后删除该提供商。
- Sign-in theme(登录主题):恢复应用在安装主题前的外观。
谁可以安装什么
- 组织管理员可以将集成安装到他们自己的组织中,仅向自己组织的应用添加提供商和主题,并且只能卸载自己组织的集成。他们的配额限制与手动添加应用或提供商时相同。
- Organization admins can install a theme only if its CSS, side panel HTML and footer HTML follow the rules for custom HTML and CSS that apply to them. Otherwise, the install fails with "the theme:
<id>uses HTML or loads files that this Casdoor only lets a global admin set". Global admins can install any theme. See What organization admins can put in custom HTML and CSS. - 一个应用一次只能有一个已安装的主题。
目录来源
Casdoor 从 conf/app.conf 中 marketplaceUrl 设置指定的 URL 下载目录索引和集成包。默认值为 https://cdn.jsdelivr.net/gh/casdoor/casdoor-integrations@dist,即 casdoor-integrations 的发布构建。
marketplaceUrl = "https://cdn.jsdelivr.net/gh/casdoor/casdoor-integrations@dist"
- 在中国大陆,由于 jsDelivr 速度较慢,请使用
https://marketplace.casdoor.cn/data。 - 在没有互联网接入的网络上,请从您自己的 Web 服务器提供 casdoor-integrations 的
dist分支副本,并将marketplaceUrl指向它。
与其他设置一样,marketplaceUrl 也可以设置为环境变量。Casdoor 会在内存中保留索引 10 分钟;Marketplace 页面上的 Refresh(刷新)按钮会重新获取它。
在安装之前,Casdoor 会将每个下载的包与索引中的 SHA-256 哈希值进行校验,检查其清单是否与请求的集成和版本匹配,并拒绝索引中标记为撤销的集成或版本。
贡献集成
集成是位于 casdoor/casdoor-integrations 中的 JSON 文件:包括一个清单,加上要创建的应用、提供商或主题以及设置指南。其 README 描述了每种类型的格式。在那里提交拉取请求以添加一个集成,或者提交 issue 以请求一个集成。合并后,它会发布到 dist 分支,Casdoor 的 Marketplace 页面会在 CDN 缓存刷新时获取它(jsDelivr 对分支的缓存时间最长为 12 小时),而 marketplace.casdoor.com 会在下次构建时显示它。