Casdoor集成市场

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.

Casdoor 官方核验KeycloakMigrationImport
你需要一个正在运行的 Casdoor,自己部署或用 Casdoor 云都可以。示例中的 https://auth.example.com 请换成你的 Casdoor 地址(Casdoor 云上类似 https://acme.casdoor.com),其他 example.com 地址也换成你自己的。

用 Casdoor 配置 Keycloak Migration

  1. 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 5000 writes 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. 2

    Install Keycloak Migration

    On the Marketplace page of Casdoor, install Keycloak Migration into the organization the realm goes to.

  3. 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. 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. 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.