# Azure AD - OIDC Setup

The Azure AD SSO integration allows for a centralised and secure login process for businesses that utilise Azure AD as their identity provider.&#x20;

OICD allows you to set up an application in AzureAD to manage access to accounts in Hava.

## Step by step guide

### 1. Go to Account Settings

On the top right, press the account preferences icon <img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FOoE0kKPnOBYrbjReruYa%2Fimage.png?alt=media&#x26;token=01d1df52-cd7d-4afd-a8d1-3eafae870a06" alt="" data-size="original"> and select account settings from the drop-down menu

![Open Your Account Settings](https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FjguZi6qF0izbrvKy2PQz%2FHava_Account_Settings_Selection.jpg?alt=media\&token=edeaa167-077e-451c-b333-9d0eb06429a4)

### 2. Select SSO Config&#x20;

From the menu on the left, select SSO Config to bring up the SSO Configuration screen

![Select SSO Config](https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FOkNmnzgjwUzfgUOhpNVk%2FHava_SSO.jpg?alt=media\&token=afeda4e7-bb35-49ab-900b-ec78a7d76056)

### 3. Select OIDC

Azure AD can use SAML or OIDC as the way to integrate their identity platform with Hava. From the two choices ('SAML' and 'OIDC') select OIDC.

![](https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FOAFmq7V4ddABCzwzWprt%2Fimage.png?alt=media\&token=c37263e4-bead-4752-ba96-19a202a960ba)

### 4. Take note of the Service provider details

You should be presented with a screen showing you two sections, Identity Provider, and Service Provider. In this case the Identity Provider is represented by Azure AD and the Service Provider is Hava.&#x20;

Take note of the `Sing-in Redirect URL` attribute in the Service Provider section, as we will use these when setting up Azure AD.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FW1BqRBo8VQd4nHrkrpsR%2FOIDC_Configuration.png?alt=media&#x26;token=e1184522-def9-485b-b03c-1fb2ce8e450d" alt=""><figcaption></figcaption></figure>

### 5. Navigate to Azure Active Directory

In the Azure Portal, go to the Azure Active Directory service, and select `App registrations` from the menu on the left side.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FcyEcro2hPx5j3RB9mepR%2Fimage.png?alt=media&#x26;token=07a9d6c2-a424-4519-acb6-588ba4c96b93" alt=""><figcaption></figcaption></figure>

### 6. Start creating a new registration

Click the `New registration` button on the top of the screen to start the process for setting up a new application registration.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2Fp11tlxwRfu4OP6TZYMH6%2Fimage.png?alt=media&#x26;token=5965e713-53bc-44f5-9bba-782eed5cba40" alt=""><figcaption></figcaption></figure>

### 7.  Register Application

You will be presented with a form where we will configure two values:

* Give the application a name that people will recongnize (e.g. hava.io)
* In the optional `Redirect URI`
  * Select `Web` as the platform
  * And put in the `Sign-in Redirect URL` from the Hava OIDC configuration screen

Finally press `Register` on the bottom of the form. Leave the other values as they are.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FleJiIYncXLcwSu16BOB1%2Fimage.png?alt=media&#x26;token=f2858f00-df36-40ea-aa13-33b79737aaea" alt=""><figcaption></figcaption></figure>

### 8. Create a secret

Next we need to create a secret to secure the connection between Hava and AzureAD.

On the left menu, select `Certificates & secrets` and then under `Client secrets` click `New client secret`

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FUvKV7F2RadX1s3hYAPHT%2Fimage.png?alt=media&#x26;token=8b622f38-e938-4866-a222-059ec4c62360" alt=""><figcaption></figcaption></figure>

### 9. Configure and Save secret

In the pane that opens, give the secret a descriptive name and select the expiry for the key

Press Add to save the secret.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FjvQSqTdBgPWy3VwLoB2K%2Fimage.png?alt=media&#x26;token=5b3e4406-ef3b-4b45-a38b-1cf2ab3f8e9d" alt=""><figcaption></figcaption></figure>

### 10. Save the secret key

The `value` attribute contains the secret key that we need to provide to Hava, save that. Ignore the `Secret ID` , we will not be using that.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FMRHrJVAuWQBnDtU08o8E%2Fimage.png?alt=media&#x26;token=e112b4fe-9a38-40c7-b494-5002883fd4ca" alt=""><figcaption></figcaption></figure>

### 11. Get Application Details

On the overview page there are two values we will need.

Save the `Application (client) ID` and the `Directory (tenant) ID` values, we will use those in the next step

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2F2HMzI5NrmK9Gxe99FWYm%2Fimage.png?alt=media&#x26;token=702c760e-e5c2-421d-bbee-15f7775cd64f" alt=""><figcaption></figcaption></figure>

### 12. Configure OIDC

Go back to Hava and press the `Add OIDC Config` button

In the form that comes up add these values:

* **Identity Provider Host:** `login.microsoftonline.com/TENANT_ID/v2.0` where `TENANT_ID` is substituted with the `Directory (tenant) ID` from step 11
* **OIDC Client Id:&#x20;**&#x20;`Application (client) ID` from step 11
* **OIDC Client Secret:** `value` from step 10

Press `Save` to save the configuration.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2Fk7PmGxShosXlydNw0Jc9%2Fimage.png?alt=media&#x26;token=4078ef61-3b08-4a38-a899-9a7c84838fa7" alt=""><figcaption></figcaption></figure>

### 13. Enable Configuration

Last step is to press the green `Enable` button on the OIDC Configuration page. Once this is done, you are ready to test the SSO integration from Azure AD.

<figure><img src="https://3601125483-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Loco-kTiJ7Tu_lfPZqb%2Fuploads%2FWXNAmzfLCvmjfYXZhEcR%2FHava_SSO_OIDC.jpg?alt=media&#x26;token=8e943901-9822-4111-a44a-fbe075622eae" alt=""><figcaption><p>Enable SSO</p></figcaption></figure>
