> For the complete documentation index, see [llms.txt](https://docs.dropzone.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dropzone.ai/edge/readme/idp-okta.md).

# Authentication with Okta

{% hint style="warning" %}
GitBook, our documentation hosting solution, is currently experiencing an outage. We are tracking this via <https://status.gitbook.com> and with our support reps.

Until it is resolved this documentation may be out of date.
{% endhint %}

The following sections describe how to set up your Dropzone instance with Okta as the OIDC provider.

{% hint style="info" %}
There are multiple ways you can configure Okta successfully with Dropzone AI; we show the simplest version here, but you are welcome to use whatever works best. Perhaps you wish to set the `user.dropzone_role` via the Application profile, or via [Okta Expression Language](https://developer.okta.com/docs/reference/okta-expression-language/) with custom logic.

As long as the values come down where we expect them, in the correct form, the "how" is up to you.
{% endhint %}

Enabling OIDC with Okta involves the following steps:

* Creating the OIDC application in Okta
* Updating the Application Profile to support Dropzone attributes
* Assigning Users to the Dropzone Application
* Configuring OIDC values for your Dropzone Environment

## Create the OIDC application in Okta

* Go to Applications > Applications
* Click Create App Integration
  * "Create a new app integration" screen opens
    * In "Sign-in Method" section, select "OIDC - OpenID Connect"
    * In "Web Application" section, select "Web Application"
    * Click Next
  * "General Settings" screen opens
    * Set "App integration name" field to a useful value, such as "Dropzone AI"
  * "Proof of possession" section: leave as default
  * "Grant type " section: leave as default
  * "Sign-in redirect URIs" section
    * You must add two URIs to this list - the bare https URL of your Dropzone environment, and a second one including `/oidc/callback` at the end
    * If your user-facing URL is dropzone.example.com, then you would add the following two URLs:
      * `https://dropzone.example.net`
      * `https://dropzone.example.net/oidc/callback/`

<figure><img src="https://146609559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFjAdEq7uAiR79I12ky1%2Fuploads%2FhullVA6B6zDwbnROJmcq%2Fokta-oidc-redirect-uri.png?alt=media" alt=""><figcaption><p>Application Sign-in Redirect URIs</p></figcaption></figure>

```
* You may leave the "Sign-out redirect URIs" section blank, or put your Dropzone environment URL if you wish to send them back to the main page again after logging out
* "Trusted Origins" section - leave blank
* "Assignments" section - set to "Skip group assignment for now"
```

At this point you should have a Dropzone application.

## Update the Application Profile

Next we set up the application profile to support the attributes such as role.

{% hint style="info" %}
This is but one way to configure your Okta to support the necessary attributes - as long as the values come down as we expect them it is up to you which Okta method you use to set these.
{% endhint %}

* Go to Directory > Profile Editor
* In "Filters" select "Apps"
* Click on the Application you just made

<figure><img src="https://146609559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFjAdEq7uAiR79I12ky1%2Fuploads%2FqlPBN2qDmPnt1R1U0Pbv%2Fokta-oidc-profile-editor-00.png?alt=media" alt=""><figcaption><p>User Application Profile</p></figcaption></figure>

* Add three new attributes
  * Click "Add Attribute"
  * Set the "Data Type", "Display Name", "Variable Name", and "Description" fields based on the following table
  * Click "Save"
  * Repeat for the remainder of the attributes

| Data Type | Display Name | Variable Name | Description |
| --------- | ------------ | ------------- | ----------- |
| string    | First Name   | `first_name`  | First Name  |
| string    | Last Name    | `last_name`   | Last Name   |
| string    | Full Name    | `full_name`   | Full Name   |

* Add the Role attribute
  * Data Type: string array
  * Display Name: Dropzone Roles
  * Variable Name: roles
  * Description: Dropzone Roles
  * Click the "Define enumerated list of values" checkbox
  * Add three entries, one for each role type
    * Admin => `admin`
    * Member => `member`
    * Read Only => `restricted-read-only`
  * Click "Save"

<figure><img src="https://146609559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFjAdEq7uAiR79I12ky1%2Fuploads%2F1GbOLOPocR9sm6Q7TV3C%2Fokta-oidc-profile-editor-02.png?alt=media" alt=""><figcaption><p>Custom Roles Attribute</p></figcaption></figure>

* When complete, these four attributes should show on the Application Profile

<figure><img src="https://146609559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFjAdEq7uAiR79I12ky1%2Fuploads%2FIoEPLi4nOr7ZzJ5KO99a%2Fokta-oidc-profile-editor-01.png?alt=media" alt=""><figcaption><p>Custom Attributes List</p></figcaption></figure>

## Assign Users to the Dropzone Application

Configure which users are allowed to log into Dropzone.

* Go to the newly created application in Okta
* Click on the "Assignments" tab at the top
* Click "Assign" > "Assign to People"
  * This will open a view of the user's profile, including our custom attributes
  * Set the First Name / Last Name / Full Name fields
  * Set the Role(s) you want for the user
  * Click "Save"
* Repeat until you've added all the people/groups who should have access
* Click "Done"

<figure><img src="https://146609559-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkFjAdEq7uAiR79I12ky1%2Fuploads%2FQcBL9QCe7gPF3iIRJdnJ%2Fokta-oidc-assignment.png?alt=media" alt=""><figcaption><p>Set user's attributes during assignment</p></figcaption></figure>

## Configure OIDC values for your Dropzone Environment

You need to congfigure OIDC values so your Dropzone Environment will talk to your IDP.

* Log into the machine running your Dropzone environment, e.g. via `ssh`
* Change to the `/opt/dropzone/deploy` directory
* Edit the `config.yml` file
* Find the oidc section, which will look similar to the following

```
# =============================================================================
# Single Sign-On / Identity Provider (OIDC)
# =============================================================================
oidc:
  # REQUIRED: OIDC client credentials. Required for all identity providers
  client-id: "..."
  client-secret: "..."

  # REQUIRED: OIDC connection type
  # Set to "fusionauth" and fill out the fusionauth section, or
  # set to "manual" and fill out the manual section
  style: "manual"

  manual:
    # REQUIRED ONLY IF using an OIDC identity provider other than FusionAuth
    logout-redirect-url: "http://..."
    op-auth-endpoint: "http://..."
    op-jwks-endpoint: "http://..."
    op-token-endpoint: "http://..."
    op-user-endpoint: "http://..."
    rp-token-endpoint: "http://..."
```

* Edit this to include the necessary values; replace `my-okta-idp.example.net` with your actual IDP URL:
  * `style`: `manual`
  * `logout-redirect-url`: `"https://my-okta-idp.example.net/login/signout"`
  * `op-auth-endpoint`: `"https://my-okta-idp.example.net/oauth2/v1/authorize"`
  * `op-jwks-endpoint`: `"https://my-okta-idp.example.net/oauth2/v1/keys"`
  * `op-token-endpoint`: `"https://my-okta-idp.example.net/oauth2/v1/token"`
  * `op-user-endpoint`: `"https://my-okta-idp.example.net/oauth2/v1/userinfo"`
  * `rp-token-endpoint`: `"https://my-okta-idp.example.net/oauth2/v1/token"`
  * `client-id` - you'll find this value as follows
    * Go to Applications > Applications
    * Select your newly created application
    * In the "General" tab, copy the value of the "Client ID" field
    * Use this for the `client-id` value in `config.yml`
  * client-secret - you'll find this value as follows
    * Go to Applications > Applications
    * Select your newly created application
    * In the "General" tab, find the `CLIENT SECRETS` section
    * There should be a client secret entry with today's date - copy this value
    * Use this for the `client-secret` value in `config.yml`

Once complete, restart the Dropzone platform

```bash
$ /opt/dropzone/bin/deploy-dropzone up
```
