Skip to content

Okta to Keycloak user converter

Turn Okta users, as a CSV with Okta’s profile names or as List Users API JSON, into a Keycloak import file with profile attributes and groups.

Runs in your browser. Nothing you paste is sent to us.

Okta export

A CSV with Okta profile names (login, email, firstName, lastName) as the header, or the JSON of GET /api/v1/users. Made-up users are filled in. It stays in your browser.

Falls back to the other when a user has none. Usernames are written in lower case.

Okta lists groups apart from users. Add a groups column, several separated by semicolons, and name it here, or leave it empty.

Output

Keycloak users

3 users 3 set a new password

Records read
3
Users in the file
3
Left out
0
Set a new password by email link
3Marked with the Update Password required action
Social or enterprise sign-in only
0Re-link by email at their first sign-in
Disabled in the source
1
In groups
2/Staff, /Support
Attributes
2department, okta_id
Password hashes left out
0Keycloak cannot verify them, so the file never holds them
JSON
{
  "groups": [
    {
      "name": "Staff",
      "subGroups": []
    },
    {
      "name": "Support",
      "subGroups": []
    }
  ],
  "users": [
    {
      "username": "[email protected]",
      "email": "[email protected]",
      "emailVerified": false,
      "firstName": "Sample",
      "lastName": "One",
      "enabled": true,
      "attributes": {
        "department": [
          "Sales"
        ],
        "okta_id": [
          "00u000000000000001"
        ]
      },
      "groups": [
        "/Staff"
      ],
      "requiredActions": [
        "UPDATE_PASSWORD"
      ]
    },
    {
      "username": "[email protected]",
      "email": "[email protected]",
      "emailVerified": false,
      "firstName": "Sample",
      "lastName": "Two",
      "enabled": true,
      "attributes": {
        "department": [
          "Support"
        ],
        "okta_id": [
          "00u000000000000002"
        ]
      },
      "groups": [
        "/Staff",
        "/Support"
      ],
      "requiredActions": [
        "UPDATE_PASSWORD"
      ]
    },
    {
      "username": "[email protected]",
      "email": "[email protected]",
      "emailVerified": false,
      "firstName": "Sample",
      "lastName": "Three",
      "enabled": false,
      "attributes": {
        "okta_id": [
          "00u000000000000003"
        ]
      },
      "requiredActions": [
        "UPDATE_PASSWORD"
      ]
    }
  ]
}
Read but not carried over
  • credentials: Okta never returns password values; used only to spot federated users.
  • status: Becomes enabled or disabled.
  • _links, lastLogin, lastUpdated, passwordChanged: History does not move.
In the admin console: Realm settings, Action, Partial import. Choose Skip or Fail for users that already exist. Keycloak keeps only attributes its user profile declares, unless the realm allows unmanaged attributes: add them to the user profile first.

How to use it

  1. Export users with GET /api/v1/users, or save a CSV with login, email, firstName and lastName.
  2. Add a groups column if you want groups, and name it here.
  3. Choose whether to mark emails as verified.
  4. Save the import file and test it on a staging realm.

What to know

Okta does not return password values or hashes through its API, so every password user sets a new password by email link.

Profile attributes other than the four standard ones become user attributes. Suspended and deprovisioned users are written as disabled, or left out if you choose.

Users whose credentials come from a social or federated provider get no password step and re-link by email.

Moving users from Okta to Keycloak

An Okta org keeps each user as a profile (login, email, first and last name and any attributes you added), a status in Okta’s lifecycle, and credentials: a password, a recovery question, or a federated provider. Keycloak keeps a user as a username, an email, names, attributes, groups and credentials of its own.

This converter reads Okta users in two shapes: the JSON of Okta’s List Users API, or a CSV whose header uses Okta’s profile attribute names. It writes a Keycloak partial import or realm import file, in your browser, with no passwords and with a set-password step for every password user.

For the whole move, from inventory to rollback, see moving from Okta.

Getting users out of Okta

Okta’s Users API is the reliable way out. GET /api/v1/users returns users page by page, each with id, status, created, profile and credentials. A short script that follows the next links collects them into one JSON array, which the tool reads as it is.

One page of users with curl (an API token with read access to users)
curl -s "https://<your-org>.okta.com/api/v1/users?limit=200" \
  -H "Authorization: SSWS <api-token>" \
  -H "Accept: application/json" > users-page-1.json

Okta’s admin console has a CSV template for importing users, not for exporting them. A CSV still works here if you make one from a report or a script: name the columns after Okta’s profile attributes (login, email, firstName, lastName, and your own attribute names), with an optional status and id. The tool also accepts the spreadsheet labels Username, First name, Last name and Primary email.

Groups are not part of a user record. List them with GET /api/v1/users/{id}/groups or per group with GET /api/v1/groups/{id}/users, and add a groups column with names separated by semicolons.

Why passwords do not move

Okta never returns a password. Its API documentation says that when a user has a password, an imported hash or a password hook, the password object in a response is a bare object with no value: "password": {}. There is no hash export, so no hash reaches Keycloak.

Every Okta user who signs in with an Okta password sets a new password after the move. The tool gives them Keycloak’s UPDATE_PASSWORD required action, and the set-password email goes out from Keycloak after the import, through the realm’s SMTP connection.

Users whose credentials provider is FEDERATION or SOCIAL sign in through another identity provider. They get no password step. Set up the same provider in Keycloak, and on their first sign-in Keycloak finds the account with the same email and asks them to confirm the link.

What the tool does with each field

OktaKeycloak userNotes
profile.emailemail, in lower caseAlso the username by default
profile.loginusername when you choose the idOkta logins are often emails too
profile.firstName, profile.lastNamefirstName, lastName
statusenabledSUSPENDED and DEPROVISIONED become disabled
createdcreatedTimestamp
idThe okta_id attributeKeep it to match records later
Other profile attributesAttributes of the same nameSuch as department or costCenter
A groups column you addgroups, as pathsNames become /Name
credentials.provider.typeWho sets a password, who re-linksNot written to the file

Okta’s profile has no per-user “email verified” flag. The tool writes emailVerified: false unless you tick “Mark every email as verified”. Tick it if your users confirmed their address when Okta activated them; otherwise Keycloak may ask them to verify it, depending on the realm’s settings.

Statuses

Okta statusIn Keycloak
ACTIVE, PASSWORD_EXPIRED, LOCKED_OUT, RECOVERYEnabled, with a set-password step
STAGED, PROVISIONEDEnabled: they never set a password, and the link lets them
SUSPENDEDDisabled
DEPROVISIONEDDisabled, or left out with the option on

The output

Sample output for one made-up user
{
  "users": [
    {
      "username": "[email protected]",
      "email": "[email protected]",
      "emailVerified": false,
      "firstName": "Sample",
      "lastName": "One",
      "enabled": true,
      "attributes": {
        "department": ["Sales"],
        "okta_id": ["00u000000000000001"]
      },
      "groups": ["/Staff"],
      "requiredActions": ["UPDATE_PASSWORD"]
    }
  ]
}

Partial import adds these users and their groups to an existing realm; the realm import file starts a new one. The page previews 20 users and the saved file holds all of them.

Apps, policies and factors

Users are one part of an Okta move. Each Okta app integration becomes a Keycloak client: OIDC apps with their redirect URIs and grant types, SAML apps with their ACS URL, entity id and attribute statements. Okta authorization servers and their custom claims become client scopes and protocol mappers. Sign-on policies become Keycloak authentication flows and, where you need them, conditional steps.

Factors do not move. We found no documented Okta export of TOTP secrets, and Okta Verify push has no Keycloak counterpart. Users who used an authenticator app set it up again at their first sign-in, through Keycloak’s Configure OTP required action, or with a passkey if you turn passkeys on in the realm.

One file from many pages

The Users API returns at most a page of users per call and links the next page in the Link header with rel="next". Collect every page and join them into one JSON array before you load it here. A short loop is enough.

All users into one array (a sketch with curl and jq)
URL="https://<your-org>.okta.com/api/v1/users?limit=200"
: > pages.ndjson
while [ -n "$URL" ]; do
  curl -s -D headers.txt "$URL" -H "Authorization: SSWS <api-token>" \
    -H "Accept: application/json" | jq -c '.[]' >> pages.ndjson
  URL=$(grep -i '^link:.*rel="next"' headers.txt | sed -E 's/.*<([^>]+)>; rel="next".*/\1/')
done
jq -s . pages.ndjson > users.json

Okta rate-limits the Users API per org. A loop like this one stays under the limit for most orgs; for very large ones, add a pause between pages and watch the X-Rate-Limit-Remaining header.

The tool also reads newline-delimited JSON, one user per line, so pages.ndjson works as it is. Use an API token from an admin account made for the move, with read access only, and revoke it when the export is done.

SAML apps

Okta orgs often hold many SAML app integrations: one per SaaS tool or partner. Each becomes a SAML client in Keycloak, and each needs a change on the other side, because the identity provider’s entity id, sign-in URL and signing certificate change. That change is made by the app’s admin, so list the owner of each app early.

Plan the certificate change with each app’s admin. Many SaaS tools accept only one identity provider certificate at a time, so the switch for that app happens at one moment: the app’s admin uploads Keycloak’s certificate, and from then on sign-in goes through Keycloak. Agree that moment with each of them, inside your cut-over window.

For each SAML app, write down the ACS URL, the audience (entity id), the NameID format and the attribute statements. The SAML client generator turns those into a Keycloak client, and the SAML metadata viewer helps compare what the app expects with what Keycloak publishes.

What your users see

Password users get one email from Keycloak with a link to set a new password. Users who used Okta Verify or an authenticator app set up an authenticator again at their first sign-in. Users who came through another identity provider confirm the link to their account once.

Everyone signs in once after the switch, because Okta sessions do not carry over. The sign-in page looks different too: clusters run Keycloak’s own themes, and custom themes are not supported yet. Tell users in the announcement where the new page is and what it looks like.

The Okta dashboard of app tiles has no direct counterpart in Keycloak. Users start sign-in from each app, or from links you publish yourself. Say so in your announcement if your users rely on the dashboard.

Mistakes to avoid

  • Stopping at the first page of the Users API. Follow the next links until there are none.
  • Leaving deprovisioned users enabled. Use the option to leave them out, or check the disabled count.
  • Forgetting attributes in the realm’s user profile, so Keycloak drops them.
  • Sending set-password emails to federated users. The tool skips them; keep it that way.
  • Switching every app on the same day without a dry run on a staging realm.

Where we come in

On Premium and Enterprise, our team does the move with you within the plan’s 10 service hours a month. On Starter you use these tools and guides, with written support. Very large orgs are scoped as Custom through the contact form. The readiness checklist lists every step for an Okta move.

Questions

Frequently asked questions

Can Okta users keep their passwords in Keycloak?

No. Okta’s API returns an empty password object, never a value or hash, so users set a new password by email link.

How do I export users from Okta?

With the Users API, GET /api/v1/users, following the next links. The admin console’s CSV template is for imports.

What happens to suspended users?

They are written as disabled. Deprovisioned users are disabled too, or left out if you choose.

Why is emailVerified false?

Okta has no per-user verified flag. Tick the option if your users confirmed their address at activation.

Where do Okta groups go?

Add a groups column from the groups API, and the tool writes Keycloak group paths and can create the groups in the same file.

Does Okta Verify move?

No. Factors are not exported, so users set up an authenticator app or a passkey in Keycloak.

Can I use a CSV from an Okta report?

Yes, if its header uses Okta’s profile names, or the labels Username, First name, Last name and Primary email. Every other column becomes a user attribute.

What happens to staged and provisioned users?

They never set an Okta password, so they come across enabled with the Update Password action. The set-password link is their first password.

Is my data uploaded?

No. Everything runs in your browser, and the saved file is made on your computer.

Rather not run Keycloak yourself?

We run it for you on a cluster of your own, with backups, upgrades and written support. Starter and Premium begin with a 7-day trial.