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.
Lernziele
- Give Casdoor read access to the Okta org.
- Vorschau und Anwendung der Migration.
- Switch the applications from Okta to Casdoor while the users keep their passwords.
Voraussetzungen
- 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.
| Okta | Casdoor |
|---|---|
| User | A 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. |
| Password | Checked with Okta on the user's first sign-in. See Passwords. |
| Group | A group with the same members. The Everyone group is skipped. |
| OIDC application | An 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. |
Passwörter
Okta never exports password hashes. Instead, Casdoor saves these users with a password that the action checks:
- 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/authnon the org's domain. - 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.
- 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
- In the Okta Admin Console, go to Security > API and open the Tokens tab.
- Click Create token, enter a name such as
casdoor-migration, and click Create token. - 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.
Die Aktion installieren
- Gehen Sie in der Casdoor Admin Console zu Identity > Marketplace.
- Search for Okta Migration and click Install.
- Choose the organization that the Okta org goes to, and click Install.
Die Migration erstellen
-
Gehen Sie zu Admin > Migrations und klicken Sie auf Add.
-
Legen Sie diese Felder fest:
Feld Wert Organization Die Organisation, in die du die Aktion installiert hast. Name A name, such as okta.Action Okta Migration. Host The domain of the Okta org, such as your-org.okta.com.Client secret The API token. Leave Client ID and Files empty.
-
Klicken Sie auf Test connection.
An error in the Report says what Okta returned, such as HTTP 401 for a wrong or revoked token.
Vorschau und Anwendung
- Klicken Sie auf Preview und warten Sie, bis der Report Previewed anzeigt.
- Überprüfen Sie die Zahlen und die Warnings. Häufige Warnungen:
- 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.
- Klicken Sie auf Apply und bestätigen Sie.
An AI agent connected to the Casdoor MCP server can do the same with plan_migration and apply_migration. See Migration tools.
Die Anwendungen umstellen
- 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 tohttps://<your-casdoor-host>/.well-known/openid-configuration. Keep the client ID and client secret. See Standard OIDC client. - In the APIs that check access tokens, replace Okta's issuer and JSON Web Key Set (JWKS) URL with Casdoor's.
- Wenn Ihre Anwendungen Claims lesen, die ein Okta-Autorisierungsserver hinzufügt, wie z. B.
groups, fügen Sie diese in Casdoor mit einem Flow hinzu, der vor der Ausgabe eines Tokens ausgeführt wird, oder mit den Token-Attributen der Anwendung.
Klicken Sie direkt vor dem Wechsel erneut auf Apply, um die Benutzer zu übernehmen, die seit dem letzten Durchlauf in Okta hinzugefügt wurden.
Ergebnis überprüfen
- Melden Sie sich bei einer der Anwendungen mit dem Okta-Benutzernamen und Passwort eines migrierten Benutzers an.
- Prüfen Sie im ID-Token, ob
subdie Okta-Benutzer-ID des Benutzers ist. - Gehen Sie zu User Management > Users, öffnen Sie den Benutzer und prüfen Sie, ob sich der Passwort-Typ von
plugin:okta-migrationzum Passwort-Typ der Organisation geändert hat.
Was nicht importiert wird
- Die Signaturschlüssel. Okta exportiert sie nicht, daher sind Tokens, die von Okta ausgestellt wurden, in Casdoor ungültig, und Benutzer melden sich nach dem Wechsel erneut an.
- MFA-Faktoren. Benutzer, die MFA verwenden, müssen sich erneut registrieren.
- Admin-Rollen, Autorisierungsserver, Richtlinien und welche Gruppen Zugriff auf welche Anwendungen haben.
- Anwendungen, die keine OIDC-Anwendungen sind, wie SAML- und Lesezeichen-Anwendungen.
- Deaktivierte Benutzer.
Siehe auch
- Migrationen
- Okta-Syncer, um weiterhin Benutzer aus einer Okta-Organisation zu lesen, die weiterhin genutzt wird
- Okta: Erstellen eines API-Tokens