https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。用 Casdoor 配置 Portainer
- 1
在 Casdoor 中注册 Portainer
在 Casdoor 控制台打开 应用,为 Portainer 添加一个应用,在它的 OIDC/OAuth 标签页复制 客户端ID 和 客户端密钥。把下面的地址加到 重定向URLs:
https://portainer.example.com
- 2
Configure OAuth in Portainer
In Portainer, open Settings → Authentication, choose OAuth, turn on Use SSO and Automatic user provisioning, pick the Custom provider and fill in:
Client ID <client ID> Client secret <client secret> Authorization URL https://auth.example.com/login/oauth/authorize Access token URL https://auth.example.com/api/login/oauth/access_token Resource URL https://auth.example.com/api/userinfo Redirect URL https://portainer.example.com User identifier preferred_username Scopes openid profile email - 3
Sign in
Save and log out. The Portainer login page now has a Login with OAuth button that sends users to Casdoor.
注意事项
- New users created by automatic provisioning have no access until you add them to a team or give them access to an environment.
- The Redirect URL in Portainer and in Casdoor must be the address people open Portainer at, exactly.
Portainer 的设置取自它的官方文档(核对于 2026年10月:Portainer OAuth);另见Casdoor 文档。Portainer 是其所有者的商标。
常见问题
Can Casdoor groups become Portainer teams?
Mapping OAuth groups to Portainer teams is a Portainer Business Edition feature. In the Community Edition, assign users to teams in Portainer.
Why preferred_username as the user identifier?
It is the Casdoor username in the userinfo response, so Portainer usernames match Casdoor's. You can use email instead if you prefer.
更多应用集成
查看全部Argo CD
应用集成Connect Argo CD to Casdoor over OpenID Connect: oidc.config in argocd-cm, the client secret, PKCE, CLI login and RBAC from Casdoor groups.
Gitea
应用集成Add Casdoor to Gitea as an OpenID Connect authentication source: the add-oauth command, callback URL, and admins from a Casdoor group.
GitLab
应用集成Configure self-managed GitLab to sign users in with Casdoor over OpenID Connect: gitlab.rb provider settings, account creation and group-based admins.
