Keycloak Migration | 提供商
Move a Keycloak realm to Casdoor
Export the realm with kc.sh, upload the files to a Casdoor migration and preview what would be added before applying it. Users keep their IDs, which are the sub of their tokens, and sign in with their Keycloak passwords; the clients keep their client IDs and secrets; and the realm's signing key comes along with its key ID, so tokens and the applications that check them keep working.
https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。用 Casdoor 配置 Keycloak Migration
- 1
Export the realm
On the Keycloak server, run
kc.sh export --dir /tmp/export --realm <realm> --users realm_file. For a realm with many users,--users different_files --users-per-file 5000writes them into several files, which can all be uploaded together. The partial export of the admin console has no users and hides the client secrets, so use kc.sh. - 2
Install Keycloak Migration
On the Marketplace page of Casdoor, install Keycloak Migration into the organization the realm goes to.
- 3
Create the migration
Under Admin > Migrations, add a migration in that organization, choose Keycloak Migration as the action and upload the export files. If the files have several realms, set the metadata to the realm to import.
Metadata {"realm": "myrealm"} - 4
Preview and apply
Click Preview to see how many certs, groups, applications, users and roles would be added, which exist already and which can't be imported and why, then Apply. Applying again later only adds what is new, and Undo deletes everything the migration added.
- 5
Switch the applications
Point the applications' issuer, or the discovery URL, at Casdoor. The imported applications sign tokens with the realm's key under its Keycloak key ID and use the standard JWT format, and the identity providers listed in the report have to be added to Casdoor as providers of the applications.
注意事项
- Users whose Keycloak password uses PBKDF2 or Argon2 sign in with it as before, and Casdoor rehashes it its own way on their first sign-in.
- Authenticator apps registered in Keycloak keep working, the users don't need to scan a new QR code.
- Users from an LDAP user federation have no password in the export: add the LDAP server to Casdoor instead.
Keycloak Migration 的设置取自它的官方文档(核对于 2026年11月:Keycloak: importing and exporting realms、Keycloak: password hashing)。Keycloak Migration 是其所有者的商标。
常见问题
Does the migration connect to Keycloak?
No. The action only reads the uploaded files, inside Casdoor's sandbox, and sends no requests.
What is not imported?
SAML clients, Keycloak organizations, authorization services, required actions and passkeys. The report lists what was left out.
更多提供商
查看全部Authelia
OAuth 提供商让用户通过 Authelia 用 OpenID Connect 登录 Casdoor:包括提供商配置,以及要加到 Authelia 配置里的客户端。
authentik
OAuth 提供商让用户用 authentik 账号通过 OpenID Connect 登录 Casdoor:包括提供商配置,以及要在 authentik 里创建的应用和 OAuth2 提供商。

超星学习通
OAuth 提供商让师生用超星学习通账号登录 Casdoor:按超星微服务开放平台的 OAuth 接口填好了授权、换取 access_token 和获取用户信息的地址。
