メインコンテンツにスキップ

Migrate from Okta

Move the users, groups and OpenID Connect (OIDC) applications of an Okta org into a Casdoor organization with the Okta Migration action from the Marketplace.


学習目標​

  • Give Casdoor read access to the Okta org.
  • 移行内容をプレビューし適用します。
  • Switch the applications from Okta to Casdoor while the users keep their passwords.

必要なもの​

  • An admin account of the Casdoor organization that the Okta org goes to. It can't be built-in.
  • An Okta admin account that can create API tokens. A super admin's token also returns the client secrets of the applications.

About the Okta migration​

The action reads the org through the Okta API with an API token, and sends requests only to the org's domain.

OktaCasdoor
UserA user. The Casdoor user ID is the Okta user ID, such as 00u1a2b3c4…, so the sub claim stays the same. The user name is the Okta login, which is often the email. Name, email, phone, title and organization go into the matching fields, and the other profile attributes into properties. Suspended users are imported as forbidden.
PasswordChecked with Okta on the user's first sign-in. See Passwords.
GroupA group with the same members. The Everyone group is skipped.
OIDC applicationAn application with the same client ID, client secret, redirect URIs and grant types, and the JWT-Standard token format. The Okta Admin Console and the Okta Dashboard are skipped.

パスワード​

Okta never exports password hashes. Instead, Casdoor saves these users with a password that the action checks:

  1. The first time a user signs in to Casdoor, the action sends the user name and password to the Okta authentication API, POST /api/v1/authn on the org's domain.
  2. If Okta accepts the password, the user is signed in, and Casdoor saves the password with the password type of the organization. Okta is not asked again for this user.
  3. If Okta rejects it, the sign-in fails as with any wrong password.

This works for users with an Okta password and for users whom Okta signs in through Active Directory or LDAP. A user who has to complete MFA in Okta still passes, because the password is correct. Casdoor asks for its own MFA once the user has set it up.

注意

Keep the Okta org running and don't delete the migration in Casdoor until your users have signed in to Casdoor once. Casdoor finds the Okta domain in the migration. After Okta is shut down, the users who haven't signed in yet reset their password in Casdoor.

Users who never activated their Okta account, and users who sign in to Okta only through an identity provider, have no Okta password. The report counts them.

Create an API token in Okta​

  1. In the Okta Admin Console, go to Security > API and open the Tokens tab.
  2. Click Create token, enter a name such as casdoor-migration, and click Create token.
  3. Copy the token value. Okta shows it only once.

The token acts with the permissions of the admin who created it. To import the client secrets of the applications, create it as a super admin. Revoke the token after the migration.

アクションのインストール​

  1. Casdoor 管理コンソールで、Identity > Marketplace に移動します。
  2. Search for Okta Migration and click Install.
  3. Choose the organization that the Okta org goes to, and click Install.

マイグレーションの作成​

  1. Admin > Migrations に移動し、Add をクリックします。

  2. これらのフィールドを設定します:

    フィールド値
    Organizationアクションをインストールした組織。
    NameA name, such as okta.
    ActionOkta Migration.
    HostThe domain of the Okta org, such as your-org.okta.com.
    Client secretThe API token.

    Leave Client ID and Files empty.

  3. Test connection をクリックします。

    An error in the Report says what Okta returned, such as HTTP 401 for a wrong or revoked token.

プレビューと適用​

  1. Preview をクリックし、Report に Previewed と表示されるまで待機します。
  2. 数値と Warnings を確認します。一般的な警告:
    • The applications that are not OIDC applications, such as SAML applications. Add them to Casdoor yourself.
    • Applications whose client secret Okta didn't return. Casdoor gives them new secrets: update them in the applications, or create the token as a super admin and preview again.
    • Users who sign in to Okta through an identity provider. Add the provider to the Casdoor applications.
  3. Apply をクリックして確認します。

An AI agent connected to the Casdoor MCP server can do the same with plan_migration and apply_migration. See Migration tools.

アプリケーションの切り替え​

  1. In each application, replace the Okta issuer, such as https://your-org.okta.com/oauth2/default, with your Casdoor address, or set the discovery URL to https://<your-casdoor-host>/.well-known/openid-configuration. Keep the client ID and client secret. See Standard OIDC client.
  2. In the APIs that check access tokens, replace Okta's issuer and JSON Web Key Set (JWKS) URL with Casdoor's.
  3. アプリケーションが Okta 認可サーバーによって追加されるクレーム(groups など)を読み取る場合は、トークン発行前に実行される フロー を Casdoor で設定するか、アプリケーションの トークン属性 にそれらを追加してください。

切り替えの直前に、再度 Apply をクリックして、前回の実行以降に Okta で追加されたユーザーを取り込みます。

結果の確認​

  1. 移行済みユーザーの Okta ログイン ID とパスワードで、いずれかのアプリケーションにサインインします。
  2. ID トークン内で、sub がユーザーの Okta ユーザー ID であることを確認します。
  3. User Management > Users に移動し、該当するユーザーを開いて、パスワードタイプが plugin:okta-migration から組織のデフォルトのパスワードタイプに変更されていることを確認します。

インポートされないもの​

  • 署名鍵。Okta は署名鍵をエクスポートしないため、Okta で発行されたトークンは Casdoor では有効ではなく、切り替え後にユーザーは再度サインインする必要があります。
  • MFA 認証要素。MFA を使用しているユーザーは再登録が必要です。
  • 管理者ロール、認可サーバー、ポリシー、およびどのグループがどのアプリケーションにアクセスできるかという設定。
  • OIDC 以外のアプリケーション(SAML やブックマークアプリケーションなど)。
  • 無効化されたユーザー。

関連項目​