---
title: Connect Okta to Directory Sync
description: Create an API app in Okta, add an Okta Directory domain in Directory Sync, and set up the sync of users and groups into OpenLM Version 26.
product: OpenLM Version 26 (legacy)
---

> **OpenLM Version 26 (legacy).** This page documents the legacy product, not OpenLM Platform.

To bring the users and groups of an Okta directory into OpenLM, connect Okta to Directory Sync. In the Directory Sync UI, this directory type is **Okta Directory**.

Directory Sync connects to Okta as an API app that you create, and it signs in with a private key instead of a password. You create the app in Okta, and then add the domain and the sync in Directory Sync.

## Before you begin

Confirm these prerequisites:

- An Okta administrator account that can create app integrations.
- The Directory Synchronization Service (DSS) connected to OpenLM SLM, and at least one approved Directory Synchronization Agent (DSA). See [Directory Sync v2x configuration](https://www.openlm.com/documentation/legacy/directory-sync/configuration).

## Create an API app in Okta

To create the app that Directory Sync connects as:

1. Sign in to your Okta account, select **Applications**, and then select **Create App Integration**.
2. Select **API Services**, enter a name for the app, and then select **Save**.
3. In **Client Credentials**, select **Edit**, and then set **Client authentication** to **Public key / Private key**.
4. Select **Add key**, and then select **Generate new key**.
5. Copy the private key in **JSON** format, and store it in a safe place. Okta shows the private key only once.
6. Select **Done**, and then select **Save**.
7. On the **Okta API Scopes** tab, grant these scopes:

   - `okta.users.read`
   - `okta.groups.read`

8. Write down your Okta domain, for example `yourcompany.okta.com`, and the **Client ID** of the app. You enter both in Directory Sync.

## Add the Okta domain

To add the directory as a domain:

1. In the Directory Sync UI, open **Domain Manager**, and then select **Add Domain**.
2. In **Directory type**, select **Okta Directory**.
3. Fill in the fields:

   - **Okta Domain**: Your Okta domain, for example `yourcompany.okta.com`.
   - **Client ID**: The client ID of the app you created.
   - **Client Private Key**: The private key you copied, in JSON format.

4. Select **Check domain connectivity**, and then select the agent that runs the test. The test takes up to 2 minutes.
5. Select **Save**. To go straight to a new sync definition for this domain, select **Save Domain & Add Sync** instead.

## Set up the sync

To sync the domain, add a sync definition as described in [Add a new sync definition](https://www.openlm.com/documentation/legacy/directory-sync/configuration#add-a-new-sync-definition). For an Okta domain, these settings differ from the ones for an LDAP directory:

| Setting | What to enter for Okta |
| --- | --- |
| **Start Sync From** | Leave it empty to sync all users and groups. To start from one group, enter `groups/<groupname>`. To sync one user, enter `users/<useremail@mail.com>`. |
| **Sync object type** | **Users**. Okta domains don't sync computers. |
| **Sync attribute** | `login`. |
| **Membership filter** | **All objects**. |
| **Search depth** | 0 or 1. Okta doesn't allow groups inside groups, so a higher value isn't accepted. |
| **Hierarchical** group rule | Directory Sync creates the groups from **Security groups**. Okta has no organizational units or administrative units. |
| **Entity attribute** group rule | Directory Sync creates the groups from an attribute of the user's profile, for example **Department**, **Country**, or **Company**. |

To change which Okta attribute fills each OpenLM user property, see [Directory attribute mappings in Directory Sync](https://www.openlm.com/documentation/legacy/directory-sync/attribute-mappings).
