# How to integrate Toky with Okta

Following these steps, you can connect Toky and Okta to provide your team an easy and secure way to start their session in Toky using [**Okta’s secure single sign on**](https://www.okta.com/products/single-sign-on/)

#### Create the App in Okta <a href="#create-the-app-in-okta" id="create-the-app-in-okta"></a>

**NOTE:** You must be an admin in the Okta account.

* Login to Okta and go to **Applications** > **Applications**, and click on **“Add Application”**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-d1cb463b5c6be597678fa2fb3dff4624641e9c7d%2Fokta_1.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on **Create New App**, select **Web** as platform, and **OpenID Connect** as Sign in method. Click on **Create**

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-8c3f32a717e2bbf9eb7a360890a8198bcb2f3526%2Fokta_2.png?alt=media" alt=""><figcaption></figcaption></figure>

* Type **Toky** as **Application name**, upload the Toky Logo as **Application logo**, and in the section **Configure openID connect**, enter the following URL in the **Login redirect URIs** field: [**https://app.toky.co/auth/okta/clientID/callback**](https://app.toky.co/auth/okta/clientID/callback)

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-4b083b3d8bd2d3a3b29252513dcfacc0b113179c%2Fokta_3.png?alt=media" alt=""><figcaption></figcaption></figure>

* You can download the following Toky logo to use it in your Okta App.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-bbb8b1653a84aa699e54ef3b8d70e10e64bb3b53%2Fokta_4.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on **Save**

#### Configuring the app in Okta <a href="#configuring-the-app-in-okta" id="configuring-the-app-in-okta"></a>

* Cick on **Edit** on the Toky app recently created
* In the **APPLICATION** section, mark the options **Allowed grant types**, **Implicit (Hybrid)**. By default the option **Allow ID Token with implicit grant type** will appear as selected.
* In the **LOGIN** section, modify the link previously saved in the **Login redirect URIs**, and replace the **clientID** in the link (<https://app.toky.co/auth/okta/>**clientID**/callback), with the value you can find in **Client Credentials** > **Client ID.**
* In the field **Login initiated by** select **Either Okta or App**, and the **Application visibility** will appear\*\*.\*\* Select **Display application icon to users**.
* In the field **Initiate login URI** copy the URL you enter in **Login redirect URIs** and remove the **“/callback”** text.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-2b9881fe278265afeeaaa20d06d686a478360f59%2Fokta_5.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on **Save**.

#### **Configure the Okta integration in Toky**

NOTE: You must be an admin in your Toky account

* Login to your Toky account and go to **Integrations** > **Okta** and follow the instructions to fill in all the required fields.
* To get the Issuer URI you must go to Okta and then, go to **Security** > **API.** You will find a list of **Authorization Servers**, copy the **Issuer URI** from the server you want to use.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-bf40e738becfc70cdab50e5f0e76a2386bae617f%2Fokta_6.png?alt=media" alt=""><figcaption></figcaption></figure>

* Get the **Client ID** and the **Client Secret** in **Aplications** > **Aplications**. Select the app we created in the first steps and go to the **General** tab, and you will find the **Client ID** in the **Client Credentials** section. Copy the value and paste it into the corresponding field in the Toky integrations tab.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-4cbadc02ca6ee1220ca6e21666750a53e7ebdf7b%2Fokta_7.png?alt=media" alt=""><figcaption></figcaption></figure>

**Important**: These values are used by Toky to start the Authorization Code Flow with Okta from the server-side.

* Enable the integration to start using the single sign-on with Okta.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-983bfe752050c764f72f70866669045edd61c471%2Fokta_8.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on **Save Changes**

#### **Assign users to the Toky app in Okta**

You must assign users to the Toky app so they can see it in their home screen in Okta and use it to log in to Toky.

* Go to your Okta account, and then to **Applications** > **Applications**. Select the Toky app and go to the **Assignments** tab.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-cd72f7ac149bf87fd0a01cbc929b4066f5ab49b8%2Fokta_9.png?alt=media" alt=""><figcaption></figcaption></figure>

* Click on **Assign** > **Assign to People** (or group if you already have one defined), find the users you want to use Toky, and assign them to the app.
* The assigned users will receive a notification and they will see Toky in their apps.

<figure><img src="https://766977813-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMgClsjsTSlUrSU2WhwDe%2Fuploads%2Fgit-blob-c8a7b667db763646a78fe4a8f907a0710175850a%2Fokta_10.png?alt=media" alt=""><figcaption></figcaption></figure>

#### How to use the integration with Okta <a href="#how-to-use-the-integration-with-okta" id="how-to-use-the-integration-with-okta"></a>

Once you finish configuring the integration, you can now login to Okta, go to the **My Apps** section, and click on **Toky** app.
