Okta user provisioning
Okta preparation, connection settings, SCIM provisioning, and Okta-specific troubleshooting for syncing the users and groups assigned to an Okta application.
Organizations whose auth provider is Okta can sync the users and groups assigned to the Okta application into AI Gateway members and teams. This page covers the Okta-side preparation and the connection settings. For what a sync changes, dry runs and runs, scheduled sync, and the removal threshold, read How user provisioning works. To have Okta push changes instead of the gateway reading Okta, use SCIM provisioning.
Before you start
Section titled “Before you start”Check every item below. If item 1 or 2 is wrong, a sync can remove every member who signs in with Okta.
- Users or groups are assigned to the Okta application. The sync reads only the assignments of the application used for sign-in.
- Federation Broker Mode is off for the Okta application. With this mode on, users sign in without an assignment, only the app sign-in policy controls access, and the application’s Assignments tab lists no users. A sync in that state plans to remove every member who signs in with Okta and every team the sync created. Turn the mode off under Federation Broker Mode on the application’s General tab (Okta: Disable Federation Broker Mode). Okta does not turn it off at once. Run a sync only after the user assignments reappear on the Assignments tab.
- A way for the sync to read Okta. Prepare one of the two. Either must be able to read the
users assigned to the application and their profiles, and the groups assigned to the
application and their members. If it cannot read groups, every run fails, including user
changes.
- An Okta API Services application (recommended). The gateway creates a key pair and Okta receives only the public key. The private key never leaves the gateway. Unlike an API token, it is not tied to the administrator account that created it and does not expire when unused. Prepare it as described in Create an API Services application.
- An API token. Create it with an Okta read-only administrator account. A token carries the permissions of the administrator who created it, expires after 30 days without use, and stops working when that administrator is deactivated (Okta: Create an API token).
- The gateway server can reach Okta directly over HTTPS. The gateway does not use a proxy server to call Okta. Installations that reach the internet only through a proxy cannot use this feature.
Create an API Services application
Section titled “Create an API Services application”You need this only for the API Services application method. Do it in the Okta admin console. The Okta screen names follow Okta’s Implement OAuth for Okta with a service app.
- In Applications and Resources → Applications, click Create App Integration. If Okta asks you to choose an experience, choose Classic experience. Choose API Services as the sign-in method. Name it and save; the application’s Client ID is shown. You enter this value in Connection settings. This is a different application from the one used for sign-in.
- On the application’s Okta API Scopes tab, click Grant for
okta.apps.read,okta.users.read, andokta.groups.read. Only the Okta Super Admin role can grant scopes. - On the application’s Admin Roles tab, click Edit assignments, choose Read-only Administrator from Role, and click Save Changes. Without an administrator role, Okta refuses the requests even with the scopes from step 2. To narrow the users, groups, and applications it can read, use an Okta custom administrator role and resource set (Okta: Use custom admin roles).
The public key is created when you save the settings in the gateway, so register it in Okta after saving.
Connection settings
Section titled “Connection settings”In the admin console, open Organization → Auth providers, open the actions menu on the active Okta card, and choose Manage provisioning. On the User provisioning page, enter the following values.
| Field | What to enter |
|---|---|
| Okta base URL | A bare https address such as https://acme.okta.com, without a path or port. It starts with the Okta address used for sign-in. Change it if you reach your Okta organization at another address, such as a custom domain |
| Okta application ID | It starts with the Client ID of the Okta application used for sign-in. If you chose a separate Client ID when you created the application, enter the 0oa… value from the address of the application’s page in the Okta admin console |
| Authentication | Okta API Services app (recommended) or API token. A first setup starts with the API Services application. Saving with the other method deletes the saved credential of the previous one |
| Client ID | Shown only for the API Services application. The Client ID of the application from Create an API Services application |
| API token | Shown only for the API token method. The token from Before you start. It is never shown again after saving. Leave it empty to keep the saved token. When you change the Okta base URL to another address, or switch to this method from the API Services application, enter the token again |
With the API Services application, Public key shows a JSON value after you click Save settings. Register it with the Okta application:
- Click Copy public key.
- In the Okta admin console, open the API Services application’s General tab and click Edit under Client Credentials.
- Change Client authentication to Public key / Private key and leave Save keys in Okta selected.
- Click Add key, then Add. In the Add a public key dialog, paste the copied JSON and click Done, then Save.
The private key stays in the gateway and is not shown on the screen either. While the API Services application method is in use, the gateway cannot be rolled back to a version without this feature. To roll back, switch to the API token method and save first.
For the other fields (scheduled sync, removal threshold, Follow Okta user status), the dry run, and the run, follow How user provisioning works. Each group assigned to the application becomes a team named after the group, shown as Okta in the Source column of the Teams page.
Regenerate the key
Section titled “Regenerate the key”When the API Services application’s key must change (a scheduled rotation, a suspected leak), click Regenerate key. Clicking Regenerate in the confirmation stops the current key at once and shows a new public key. Every run fails until the new public key is registered in Okta.
- Create the new key with Regenerate key.
- Add the new public key to the Okta application, following the registration steps in Connection settings.
- Click Run dry run to check that the new key works.
- Delete the old public key from the Okta application.
With scheduled sync on, a scheduled run between steps 1 and 2 can fail. Turn scheduled sync off during the rotation to keep failures out of the history.
SCIM provisioning
Section titled “SCIM provisioning”Scheduled sync has the gateway read Okta at set times. With SCIM provisioning, Okta sends each change to the gateway as soon as an assignment or profile changes in Okta. An organization uses one or the other.
| Scheduled sync | SCIM provisioning | |
|---|---|---|
| When a change arrives | At the next run (scheduled or manual) | As soon as it changes in Okta |
| Connection direction | Gateway → Okta | Okta or the Okta Provisioning Agent → gateway |
| What it needs | An Okta API Services application or an API token | An Okta app for SCIM only, a SCIM token, and a route into the gateway’s /scim/v2 |
| A user suspended in Okta | The member is deactivated (when Follow Okta user status is on) | Not reflected |
| Removal threshold, dry run | Apply | None |
Before you use SCIM
Section titled “Before you use SCIM”- Okta can reach the gateway’s
/scim/v2. If the gateway is reachable only from your network, install the Okta Provisioning Agent inside it (Okta: Install the Okta Provisioning Agent). To open the route, read SCIM path on the load balancer. - Your Okta organization offers provisioning. If the Provisioning field appears on an Okta app’s General tab, it does. If it does not, contact Okta support.
- You create a separate app for SCIM. Okta cannot add SCIM to an OIDC app created with the App Integration Wizard. Keep the OIDC app for sign-in and create one more SAML 2.0 app for SCIM only. Nobody signs in through it. (Okta: Add SCIM provisioning to app integrations)
- You assign the same groups to both apps. A user assigned only to the sign-in app becomes a member on sign-in, but unassigning them there never reaches the gateway, so they stay a member.
1. Switch the gateway to SCIM
Section titled “1. Switch the gateway to SCIM”- On the User provisioning page, choose SCIM provisioning under Synchronization method and select Save settings. In the confirmation, select Switch. Scheduled sync turns off and the SCIM connection section appears. The dry run and run buttons go away; the run history stays.
- Under SCIM connection, select Issue token. The token is shown once. Copy it, then close the dialog. Afterwards only the start of the token and when it was issued are shown.
- Select Copy URL next to SCIM base URL. This is the address you enter in Okta.
2. Set up the SCIM app in Okta
Section titled “2. Set up the SCIM app in Okta”The Okta screen names and fields follow Okta’s Add SCIM provisioning to app integrations.
-
In the Okta Admin Console, go to Applications → Applications → Create App Integration and choose SAML 2.0. Nobody signs in through this app, so the SCIM base URL works as the Single sign-on URL and the Audience URI.
-
On the app’s General tab, select Edit under App Settings, set Provisioning to SCIM, and save. A Provisioning tab appears.
-
Under Provisioning → Integration, select Edit and enter the following.
Field What to enter SCIM connector base URL The SCIM base URL you copied in step 1 Unique identifier field for users userNameSupported provisioning actions Push New Users, Push Profile Updates, Push Groups Authentication Mode HTTP Header, with the token from step 1 in Authorization Select Test Connector Configuration, and save once it succeeds.
-
Under Provisioning → To App, select Edit and turn on Create Users, Update User Attributes, and Deactivate Users.
-
On the Assignments tab, assign the same groups as the sign-in app. The users appear on the gateway’s Members page without any role.
-
Choose the groups to turn into teams on the Push Groups tab, By name (Okta: Enable Group Push). A group used for app assignment cannot be pushed, so keep separate groups for pushing. A team named after each group appears on the Teams page with Okta as its source. If scheduled sync already made a team with the same name, choose Link Group rather than Create Group under Match results and push action. The team and its roles then carry on. This option appears only for apps that support Okta Group Linking (Okta: Configure Group Linking).
What to know about SCIM
Section titled “What to know about SCIM”- Suspensions are not reflected. Okta sends nothing when it suspends a user. A suspended user stays an active member and their Gateway Keys keep working. To stop them, deactivate or unassign the user in Okta instead of suspending them, or deactivate the member on the Members page.
- Unassigning removes the member at once. There is no removal threshold, so unassigning many users in Okta removes them all right away. Assigning them again registers them as new members without permissions.
- The last administrator is not removed. When only one active organization administrator is left, unassigning that user is refused and Okta records an error.
- Replacing the token stops the old one at once. Requests from Okta fail until you enter the new token in Okta’s Authorization field.
- Switching back to scheduled sync revokes the SCIM token. Turn off provisioning on the Okta app as well. Scheduled sync needs the Okta authentication (an API Services application or an API token) from Connection settings.
Troubleshooting
Section titled “Troubleshooting”| Symptom | What to check |
|---|---|
| A dry run plans to remove every member, or “Stopped without changes: more members than the removal threshold would be removed.” | Check in order: ① the Okta application ID is the application used for sign-in, ② Federation Broker Mode is off, ③ the Okta base URL is the same Okta organization used for sign-in. Do not raise the threshold to get past it |
| The identity provider rejected the sync credentials. | The API token method is in use. The token expired or lacks permissions. Check that it can also read groups |
| Okta refused the API Services application. | Check ① that the public key on the screen is registered with the Okta application (the new one, if you regenerated it) ② that the Client ID is correct ③ that okta.apps.read, okta.users.read, and okta.groups.read are granted ④ that the Read-only Administrator role is assigned |
| The identity provider could not find the application that sync reads. | Check the Okta application ID |
| The identity provider is rate limiting requests. | Run again later. A less frequent schedule also helps |
| Could not read the directory from the identity provider. | Check the Okta address and the server’s outbound connection. If the assigned users or groups exceed the limits in the message, assign fewer |
| The Okta address is not allowed. | Enter the public HTTPS address of your Okta organization |
| SCIM: Test Connector Configuration fails with 401 | The token is wrong or was replaced, or the Synchronization method is scheduled sync. Issue a new token and enter it |
| SCIM: 403 | The active auth provider is not Okta, or the license grace period has ended |
| SCIM: requests do not reach the gateway (timeout, or the console’s HTML comes back) | Check the SCIM path on the load balancer |
| SCIM: assigning a user fails with 400 | The Okta profile has no email |
| SCIM: unassigning a user fails with 409 | The user is the last active organization administrator. Make someone else an administrator first |
| SCIM: Okta shows only a status code with no reason | Through the Okta Provisioning Agent, Okta receives only the status code. Search the gateway server log for scim request refused; status, scim_type, and detail give the reason: docker compose logs server | grep "scim request" |