# Okta Configuration

## Steps to follow

* [Create a new Application](#create-a-new-application)
* [Set up Single Sign-On](#set-up-single-sign-on)
  * [Configure Attributes](#configure-attributes)
* [Enter OKTA's metadata into Sleuth](#enter-oktas-metadata-into-sleuth)
  * Option 1: Link to metadata file
  * Option 2: Enter metadata manually
* [Assign People/Groups to the Application](#assign-people-groups-to-the-application)

## Create a new Application

Sign in to the **OKTA Dashboard** as an administrator. Open the menu in the top-left corner, expand the " **Applications**" section and click "**Applications**:

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FEKrVgzo1kFPEEWYbkL7z%2Fimage.png?alt=media&#x26;token=25ec00d8-d1ee-4f9b-b696-0d750d25b83e" alt=""><figcaption></figcaption></figure>

On the "**Applications** "page click "**Create App Integration**". In the pop-up "**Create a new app integration**" select "**SAML 2.0**" as the Sign-in method and click "**Next**":

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FMbTaSHhqFFk4OuZOFC4q%2Fimage.png?alt=media&#x26;token=60e25532-3ba8-4c30-8e48-032285effb27" alt=""><figcaption></figcaption></figure>

On the "**General Settings**" tab enter a name for your application (*e.g., Sleuth*) and click "**Next**":

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FSAZWvzqsiCrYCIqEPyvN%2Fimage.png?alt=media&#x26;token=4fff9b39-645b-4806-89b8-e444c4d4ce82" alt=""><figcaption></figcaption></figure>

## Set up Single Sign-On

On the "**Configure SAML**" page, **fill in the necessary metadata** (*found in Sleuth*), using the following reference:

| OKTA                            | SLEUTH                     | EXAMPLE                                                                               |
| ------------------------------- | -------------------------- | ------------------------------------------------------------------------------------- |
| **Single sign on URL**          | Assertion Consumer Service | `https://app.sleuth.io/complete/saml/`                                                |
| **Audience URI (SP Entity ID)** | SAML Entity ID             | `https://app.sleuth.io/saml/metadata/`                                                |
| **Default RelayState**          | Default Relay State        | <p><code>sleuth</code> </p><p><em>(should be your <strong>org slug</strong>)</em></p> |

Set the "**Name ID format**" to "**Email Address**" and click the "**Show Advanced Settings**" link to expand the settings:

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2Fk4NNr6w4ZtjLaRIQBLPV%2Fimage.png?alt=media&#x26;token=414ae628-384d-4f9e-a924-7fde5a1cf5b7" alt=""><figcaption></figcaption></figure>

Save the "**Sleuth x509 Certificate**" ([found in Sleuth](https://help.sleuth.io/settings/organization/signup/saml/broken-reference)) in a .**pem** file, then click "**Browse files...**" next to "**Signature Certificate**" and **upload the saved file**. Activate the "**Enable Single Logout**" option and enter the necessary information:

| OKTA                  | SLEUTH                | EXAMPLE                           |
| --------------------- | --------------------- | --------------------------------- |
| **Single Logout URL** | Single Logout Service | `https://app.sleuth.io/saml/sls/` |

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FVovOzF6WYLLuArendJAo%2Fimage.png?alt=media&#x26;token=ad7625c8-14c2-45c9-ab29-2ba3bd8539eb" alt=""><figcaption></figcaption></figure>

### Configure Attributes

In the "**Attribute Statements**" section add the following Attributes (*using the "**Add Another**" button*):

| NAME            | NAME FORMAT | VALUE          |
| --------------- | ----------- | -------------- |
| **email**       | Unspecified | user.email     |
| **first\_name** | Unspecified | user.firstName |
| **last\_name**  | Unspecified | user.lastName  |

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FHJ6dQoDGVIj67h0CK7Xe%2Fimage.png?alt=media&#x26;token=ab049465-8d78-4aba-9ace-73c49d611024" alt=""><figcaption></figcaption></figure>

Leave the "**Group Attribute Statements**" as they are.

Click "**Preview the SAML Assertion**" if you want to inspect the Assertion before proceeding. Then click "**Next**" at the bottom-right of the page.

On the "**Feedback**" page select "**I'm an Okta customer adding an internal app**" and click "**Finish**" at the bottom-right of the page (*you can leave the rest of the fields blank*).

## Enter OKTA's metadata into Sleuth

You can now choose between **pointing Sleuth to a URL** where the IdP's metadata is now available, or **entering the metadata into Sleuth manually**.

{% tabs %}
{% tab title="Option 1: Link to metadata file" %}
In OKTA in the "**SAML Signing Certificates**" section under your Application, find the certificate with status "**Active**", click on the "**Actions**" link at the right end of its row and click "**View IdP metadata**":

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FqdAG7YaXxPD02sOTfUuP%2Fimage.png?alt=media&#x26;token=c2e17848-ff37-47b7-a7ae-7f55441f7303" alt=""><figcaption></figcaption></figure>

The **XML file** will open in a new tab in your browser -> **select and copy its entire URL**.

In Sleuth, click the "**point Sleuth to metadata file URL**" link to trigger the input modal and **paste the copied URL** into the field, then click "**Save**":

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FLhtPPUMX7OHXaEUf2HF7%2Fimage.png?alt=media&#x26;token=dc74cdbd-a186-48ca-b522-d6230c54081b" alt=""><figcaption></figcaption></figure>

The remaining fields in Sleuth will get **populated automatically**, just click "**Test Metadata and Save**":

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FLyuwIh8aOc1u2VrJe3IB%2Fimage.png?alt=media&#x26;token=4142b6aa-a34b-4b8a-a3f1-d796da1f3686" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Sleuth defaults all of the Advanced configuration to the most commonly used values, but depending on your IdP configuration you might need to adjust "**Advanced settings**".
{% endhint %}

## Assign People/Groups to the Application

On the Application's homepage click the "**Assignments**" tab, then click "**Assign**" and select either "**Assign to People**" (*to assign individual users*) or "**Assign to Groups**" (*to assign to groups of users*):

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FVxngjDrfSpxgXk4BXGwx%2Fimage.png?alt=media&#x26;token=6d227fea-b5dc-4a3f-b754-6a3dd02d1be0" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Option 2: Input metadata manually" %}
In OKTA in the "**SAML Signing Certificates**" section under your Application, click the "**View SAML setup instructions**" button:

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FB4uqzhyVk1jNasWZx9E1%2Fimage.png?alt=media&#x26;token=c7493ab2-88ee-4abf-88b6-47ab5f703266" alt=""><figcaption></figcaption></figure>

**Fill in the necessary metadata**, using the following reference, and click "**Test Metadata and Save**":

| SLEUTH          | OKTA                                 | EXAMPLE                                                                                                         |
| --------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| **Entity ID**   | Identity Provider Issuer             | `http://www.okta.com/<...>`                                                                                     |
| **SSO URL**     | Identity Provider Single Sign-On URL | `https://<...>.okta.com/app/<...>/sso/saml`                                                                     |
| **SLO URL**     | Identity Provider Single Logout URL  | `https://<...>.okta.com/app/<...>/slo/saml`                                                                     |
| **Certificate** | X.509 Certificate                    | <p><code>-----BEGIN CERTIFICATE-----</code><br><code><...></code><br><code>-----END CERTIFICATE-----</code></p> |

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FhMGUyjzaDEO7KtPTJqcY%2Fimage.png?alt=media&#x26;token=56388aca-3a94-4fa7-8ded-e5d3e8254cfc" alt=""><figcaption></figcaption></figure>

<figure><img src="https://2832637360-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1bR_-Od0islbiOl4G0%2Fuploads%2FkVnvnOV0VtdFWxXPen5e%2Fimage.png?alt=media&#x26;token=8076b34c-76d9-427b-8dc8-4184b261a780" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Sleuth defaults all of the Advanced configuration to the most commonly used values, but depending on your IdP configuration you might need to adjust "**Advanced settings**".
{% endhint %}
{% endtab %}
{% endtabs %}
