> ## Documentation Index
> Fetch the complete documentation index at: https://statsig-4b2ff144-serverless-cloudflare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Okta SCIM Org Roles

## Update Okta User Org Role

For every user, Statsig surfaces a SCIM field named `statsigOrgRole`. Through this field, you can manage organization user roles.
Currently, Okta can only push role updates to Statsig.

### Step 1. Create the Custom Attribute in Okta

Navigate to `Directory > Profile Editor` and select the User (default) Okta profile. This represents all of the Okta users' attributes.
Scroll down and press `Add Attribute` and fill out the new attribute to have the variable name `statsigOrgRole`.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step1.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=c3dc1887b431a1a4b10ba1a6d09c173d" alt="img" width="1396" height="1514" data-path="images/okta_scim_steps/org_steps/step1.png" />
</Frame>

### Step 2. Create the Custom Attribute in the Statsig SCIM Integration

Now Navigate to the `Statsig SCIM Integration's User Profile` in the `Profile Editor`.
Add an new attribute that matches the following format:

* Variable name: `statsigOrgRole`
* External namespace: `urn:ietf:params:scim:schemas:core:2.0:User`

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step2.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=dd01a8407a27f61ed2a513d69660e96a" alt="img" width="1292" height="1954" data-path="images/okta_scim_steps/org_steps/step2.png" />
</Frame>

### Step 3. Create a Mapping from Statsig to Okta for the Custom Attribute

On the same Statsig SCIM profile editor, navigate to the `Mappings` button.
Scroll down to the new attribute `statsigOrgRole` and map `user.statsigOrgRole` to the Okta attribute `statsigOrgRole`.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step3.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=7bc71c69cf05755870b5f799ef16a6ad" alt="img" width="2004" height="830" data-path="images/okta_scim_steps/org_steps/step3.png" />
</Frame>

### Step 4. Create a mapping from Okta to Statsig for the Custom Attribute

Now navigate to the Okta User to Statsig SCIM user mapping.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step4_1.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=d017284cec2dc87b3e9576d604bd1656" alt="img" width="1930" height="614" data-path="images/okta_scim_steps/org_steps/step4_1.png" />
</Frame>

Scroll down to the `statsigOrgRole` attribute and map `user.statsigOrgRole` to the Okta attribute `statsigOrgRole`.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step4_2.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=f1172325a664f9cd2825bbed116f5e1f" alt="img" width="1822" height="522" data-path="images/okta_scim_steps/org_steps/step4_2.png" />
</Frame>

Now all users will be synced with their organization role. On the Statsig SCIM integration you can modify a user's role directly as well.

### Step 5. Modify Integration Mappings

Navigate to the Statsig SCIM integration provisioning section.
Under the "To App" tab, scroll down to the `statsigOrgRole` attribute.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step5_1.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=85b74ea4cea9186fc3fd7b60ac31abdd" alt="img" width="1394" height="480" data-path="images/okta_scim_steps/org_steps/step5_1.png" />
</Frame>

Set the attribute value to `Map from Okta Profile` and `statsigOrgRole`.
Set apply on `Create and update`.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step5_2.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=e8a25b7c0460f9e73468dd7cccdd39bc" alt="img" width="1548" height="622" data-path="images/okta_scim_steps/org_steps/step5_2.png" />
</Frame>

Navigate to the "To Okta" tab and scroll down to the `statsigOrgRole` attribute.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step5_3.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=cc38b0bd31878af85fc04cce15753d6a" alt="img" width="1386" height="456" data-path="images/okta_scim_steps/org_steps/step5_3.png" />
</Frame>

Set the attribute value to `Map from Statsig Profile` and `statsigOrgRole`.
Set apply on `Create`.

<Frame>
  <img src="https://mintcdn.com/statsig-4b2ff144-serverless-cloudflare/07-Ip8yoBF41fH_r/images/okta_scim_steps/org_steps/step5_4.png?fit=max&auto=format&n=07-Ip8yoBF41fH_r&q=85&s=f72ec9bafbccb5a2db33f36ad93a0dd8" alt="img" width="1548" height="526" data-path="images/okta_scim_steps/org_steps/step5_4.png" />
</Frame>
