https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。用 Casdoor 配置 ZITADEL
- 1
Create a web application
In the ZITADEL Console, open the project the application belongs to (or create one), click New under its applications and choose Web.
- 2
Choose Code and add the redirect URI
Pick the Code authentication method: Casdoor sends the client secret with HTTP Basic authentication, which is what Code expects. Then add the redirect URI:
Redirect URIs https://auth.example.com/callback - 3
Copy the credentials
Create the application. ZITADEL shows the Client ID and Client Secret once, so copy both now.
- 4
在 Casdoor 中添加 ZITADEL 提供商
在 Casdoor 控制台打开 提供商,点击 添加,填写:
类别 OAuth 类型 OIDC 显示名称 ZITADEL 客户端ID <client ID> 客户端密钥 <client secret> Issuer链接 https://zitadel.example.com 认证URL https://zitadel.example.com/oauth/v2/authorize Token链接 https://zitadel.example.com/oauth/v2/token 范围 openid profile email UserInfo链接 https://zitadel.example.com/oidc/v1/userinfo 登出URL https://zitadel.example.com/oidc/v1/end_session 启用PKCE 开启 点击 Issuer链接 旁边的 请求,会从 ZITADEL 的 discovery 文档自动填好其余地址。同一个组织里所有 OIDC 类型的提供商都通过同一个字段关联用户,所以如果这个组织已经有一个 OIDC 提供商,请把 类型 改成 Custom Flexible,它按提供商分别关联账号。
- 5
把提供商加到应用上
打开 应用,编辑用户登录的那个应用,在它的 提供商 标签页添加这个提供商。之后登录页上就会出现 ZITADEL 按钮。
注意事项
- ZITADEL's
preferred_usernameis the login name, such asalice@acme.zitadel.cloud, and Casdoor uses it as the username of new users. Set a user mapping forusernamein Casdoor if you want something else. - ZITADEL only accepts plain-http redirect URIs in Development mode, so use https for Casdoor.
ZITADEL 的设置取自它的官方文档(核对于 2026年10月:ZITADEL OIDC endpoints、ZITADEL claims、ZITADEL applications)。ZITADEL 是其所有者的商标。
常见问题
Do I need User Info inside ID Token?
No. Casdoor also calls ZITADEL's userinfo endpoint, which returns the name and email.
Can I use the PKCE authentication method instead?
That method issues no client secret, while Casdoor's provider is a confidential client. Use Code; Casdoor sends a PKCE challenge on top of the secret anyway.
更多身份提供商
查看全部Authelia
身份提供商Let people sign in to Casdoor through Authelia over OpenID Connect: the provider settings, and the client to add to Authelia's configuration.
authentik
身份提供商Let people sign in to Casdoor with their authentik accounts over OpenID Connect: the provider settings, and the application and OAuth2 provider to create in authentik.
GitLab Self-Managed
身份提供商Let people sign in to Casdoor with accounts on your own GitLab over OpenID Connect: the provider settings, and the OAuth application to create in GitLab.
