> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Okta

> Connect Okta so agents can review user access, investigate sign-ins, and manage CloudThinker-owned groups through your Approvals

Connect Okta to let CloudThinker agents review users, groups, application assignments, and sign-in activity, and to create and staff CloudThinker-owned groups through your [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md). The connection uses an Okta **API token**, which acts with the permissions of the administrator who created it.

## Prerequisites

* An Okta organization on an Okta-hosted domain such as `okta.com`, `okta-emea.com`, or `oktapreview.com`. Custom domains and Okta for Government domains (`okta-gov.com`, `okta.mil`) are not accepted.
* A **dedicated Okta administrator** account to create the token, with the roles in [Required permissions](#required-permissions).

> [!NOTE]
>
> The token can do anything its creator can. A token created from a personal super administrator lets agents read your whole organization. Create it from a dedicated, least-privilege administrator instead.

## Setup

**1. Create an API token**

Sign in to the Okta Admin Console as the dedicated administrator. Go to **Security → API → Tokens**, click **Create token**, and name it `cloudthinker`.

In the same dialog, Okta lets you limit where calls from this token can originate. To lock the token to CloudThinker, pick a network zone that holds CloudThinker's egress IPs. These docs don't publish CloudThinker's egress IP list: ask your CloudThinker contact, or [contact us](https://cloudthinker.io/contact). You can also cap the token's share of your org's rate limit below 100% so agents can't starve your other integrations.

Copy the value right away. Okta shows it once. Okta also expires a token that goes 30 days without a request, so a connection you never use will stop working.

**2. Copy your Okta domain**

In the Admin Console, click your name in the top right. The domain shows under your email, for example `acme.okta.com`. Keep only the hostname, such as `acme.okta.com`. Drop `https://`, any port, and any path.

Use the plain organization domain, not the Admin Console address in your browser (`acme-admin.okta.com`).

**3. Add the connection in CloudThinker**

In the sidebar, click **More → Workspace settings → Connections**, then on the **Builtin Connections** tab select **Okta**, and fill in **Okta domain** and **API token**. Click **Connect**.

**Success state:** the connection shows **Connecting** and **Verifying**, then **Connected**, with the message `Okta connection verified (acme, ACTIVE)`. To prove the token works, CloudThinker reads your organization settings and nothing else.

## Connection details

| Field | Description | Example |
| - | - | - |
| **Okta domain** | Organization hostname, with no scheme, port, or path | `acme.okta.com` |
| **API token** | Token from **Security → API → Tokens** | `00Ab...` |

## Required permissions

An Okta API token has no scopes of its own. It inherits its creator's administrator roles, so you control access by choosing that administrator's roles.

| You want agents to | Role for the token's administrator |
| - | - |
| Review users, groups, applications, and one person's access | **Read-only Administrator** |
| Investigate sign-ins in the System Log | **Read-only Administrator** |
| Create CloudThinker-owned groups | A custom admin role with **Create groups** (organization scope) |
| Add or remove members of those groups | The same custom role with **Manage group membership** and **Edit users' group membership** |

> [!TIP]
>
> Start with **Read-only Administrator** alone. Add the custom group role only when you want agents to manage on-call or access groups.

### Set up the custom group role

1. In the Admin Console, go to **Security → Administrators → Roles** and click **Create new role**. Select **Create groups**, **Manage group membership**, and **Edit users' group membership**, then save.
2. Open the **Resource sets** tab and click **Create new resource set**. Add **All groups** and **All users**.
3. Open the **Admins** tab, click **Add assignment**, pick the dedicated administrator, and bind it to the role and the resource set.

Scope the resource set to all groups. CloudThinker creates the groups, so you can't list them ahead of time, and CloudThinker already refuses changes to any group it didn't create. The token itself could still change any group, so treat it like any admin credential.

## Agent capabilities

| Capability | What agents can do |
| - | - |
| **Identity inventory** | List users with their status, and groups, by name |
| **Person access review** | Trace one exact user to their groups, assigned applications, and recent System Log events |
| **Sign-in investigation** | Review a time window of the System Log for failures, lockouts, actors, and client IP addresses |
| **Application access** | Compare direct and group assignments, and flag inactive applications that still have assignments |
| **Group creation** | Create an Okta group owned by CloudThinker, through your Approvals |
| **Membership changes** | Add or remove one exact user in one CloudThinker-owned group, through your Approvals |

### Limits

* **Counts are samples**: Okta's list APIs return pages, not totals. Agents report the rows they read and whether more pages exist, never your organization's total.
* **90 days of sign-ins**: Okta keeps System Log events for 90 days, so older sign-ins aren't reachable.
* **Okta rate limits apply**: a busy org can return HTTP 429. See [Troubleshooting](#troubleshooting).

### Verify the connection

```text theme={null}
Show the Okta users and groups this connection can read, and the applications they're assigned to
```

Expect named users, groups, and applications, each list marked with whether more pages exist. A 403 error means the token's administrator is missing **Read-only Administrator**.

### Example prompts

```text theme={null}
Which groups and applications does Okta user 00u1a2b3c4d5e6f7g8h9 have, and what did they do in the last 7 days?
Investigate failed Okta sign-ins in the last 24 hours and group them by outcome
Create an Okta group named CloudThinker-OnCall and add Okta user 00u1a2b3c4d5e6f7g8h9
```

The last prompt names the member by Okta user ID because email masking is on by default in [guardrails](https://docs.cloudthinker.io/guide/security/custom-guardrails.md), and the agent can't use a masked email as an Okta login. It makes two changes, each checked on its own: one to create the group, one to add the member. Where a person has to approve, expect two approval requests.

## Write access

Agents can make exactly three kinds of change. Each one goes through [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) and starts with a fresh read of your organization.

They also need **Allow writes** on, which starts on. To lock writes in CloudThinker, open **Okta** in **More → Workspace settings → Connections** and turn off the **Allow writes** switch on its detail panel.

Every change an agent makes goes through your workspace's [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) first. On the default **Auto · Rules + AI · Ask me** mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on [Rule enforcement](https://docs.cloudthinker.io/guide/approvals/rules.md#troubleshooting) for your workspace. Choose **Manual** to approve every change yourself.

| Change | Safety check |
| - | - |
| Create a group | Creates an Okta group and writes a signed CloudThinker ownership receipt, bound to its group ID, as the first line of the group's description |
| Add one member | Needs the exact group ID, its current name, a valid ownership receipt, and an exact user login or ID |
| Remove one member | Same checks, then confirms the resulting membership |

You can see the receipt in the group's description in Okta. If someone edits that line or recreates the group, agents treat it as not CloudThinker-owned and refuse further changes. A rename is fine: the next request just needs the new name.

Everything else is refused: renaming or deleting groups, changing groups CloudThinker didn't create, user lifecycle, factors, credentials, sessions, tokens, admin roles, application assignments, and policies. For those, agents give you the Admin Console steps to do it yourself.

## Troubleshooting

> [accordion] Okta rejected the API token
>
> The token is wrong, revoked, or expired after 30 days without a request. Okta also deactivates a token when the administrator who created it is deactivated or suspended. Check **Security → API → Tokens** in Okta and create a new token if needed. To swap it in, follow [Rotate a credential](https://docs.cloudthinker.io/guide/connections/overview.md#rotate-a-credential): click the pencil icon on the Okta row, then **Replace…** in **Edit Instance**.

> [accordion] Okta domain must be a supported Okta hostname
>
> The value has a scheme, port, path, or credentials, or it isn't an Okta-hosted domain. Enter only the hostname, such as `acme.okta.com`. Custom domains are not accepted.

> [accordion] The token is valid, but its admin role cannot read the org settings
>
> The token's administrator lacks read access. Give that administrator **Read-only Administrator**, or create the token from one who has it. A 403 on a later question means the same for that resource. It doesn't mean the data is absent.

> [accordion] That domain answered, but it does not serve the Okta org settings
>
> The domain is misspelled, or it's the `-admin` console address rather than your organization domain. Click your name in the top right of the Admin Console and copy the domain shown under your email.

> [accordion] An agent can't find a person by email
>
> [Guardrails](https://docs.cloudthinker.io/guide/security/custom-guardrails.md) mask email addresses by default, and the agent can't use a masked email as an Okta login. Give it the Okta user ID instead, from **Directory → People** in the Admin Console.

> [accordion] Okta rate-limited the request
>
> Okta returned HTTP 429. Wait for the rate-limit window to reset, then ask again.

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Use a dedicated administrator**: the token inherits its creator's roles, so a personal super administrator gives agents far more reach than they need.
- **Writes stay inside CloudThinker-owned groups**: approving a change can't widen what agents may touch, and every membership change is checked afterwards.

## Related

> [card] [Keycloak](https://docs.cloudthinker.io/guide/connections/keycloak.md)
>
> Inspect realms, users, clients, roles, and auth flows in Keycloak.

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Decide which Okta changes run, wait for a person, or are refused.

> [card] [Single Sign-On](https://docs.cloudthinker.io/guide/security/sso.md)
>
> Sign in to CloudThinker through Okta, and provision accounts with SCIM.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.